Hi all, I've tried this a few different ways to no avail. The core use case I'm trying to satisfy is populating a regular Jira field (non-asset field) with Jira users based on an Asset object's attributes. So:
Currently, I've created an Asset field and can successfully load the Software object into it upon issue creation. Once loaded, I can see the attributes for the Primary Approvers.
I want to pull the email addresses of the Primary Approvers and populate a multi-user field with the values. (Note: this works when there is only a single value to pull)
However, I'm seeing the following result when I run logs for adding multiple emails:
[john.doe@email.com, jane.doe@email.com]
Jira is treating this as a single user rather than two separate emails which makes the automation fail.
Next I tried breaking this up into a list by plugging in the split() function. However, it still doesn't seem to change anything. I also tried modifying the result as if it were text by using the concat() function, but it also did not work as expected.
I'm trying to understand how I can get Jira to recognize multiple emails and then add them to the multi-user field. I'm scoured the available documentation and Community posts but none have pointed to the correct solution.
If the asset attribute is always printing multiple emails separated by comma, then you could use smart values for looking before and after specific characters.
when it comes to entering the data you may be able to do it all in one edit action. Otherwise, edit the issue once, then re-fetch the issue and edit again using the smart value of the user field and add the next email address.
I realise I may have just made that more confusing so let me know and I’ll add some screenshots
Hey @Dan Tombs thanks for the reply. This is sort of what I ended up doing to get it working, but it feels pretty janky to me.
I had to create a variable to retrieve:
{{issue.Approval Type.Primary Named Approver(s).Work Email}}
This is what provided me with the strange format from my original post:
[john.doe@email.com, jane.doe@email.com]
To get it to work, I had to strip it of the square brackets and whitespace:
{{primaryApprovers.replaceAll("[\[\]]", "").replaceAll("[ ]", "")}}
Then I had to break it into distinct pieces and plug each individually into the Edit Issue action of A4J:
{{primarryApproversList.split(",").get(0)}}
{{primarryApproversList.split(",").get(1)}}
{{primarryApproversList.split(",").get(2)}}
So it does work now but thankfully my requirements are only that there will ever be 1 - 3 approvers. If there's an easier way to just iterate over the list it would make this much more scalable.
Best,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As of right now there isn't this is the best way. I know it is annoying but at least you got there regarding the automation.
Dan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sounds good, just wanted to make sure I wasn't overcomplicating it unnecessarily. Appreciate the second set of eyes.
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.