I have an incident request type which requires the submitter to choose which department(s) should be involved in the incident. Then through Jira automation, I'd like the associated department head(s) to be added as request participant(s) and then sent an email which contains a link to the issue. I've created two lookup tables:
Using the branch/apply-to-each function to loop through the chosen departments and send emails one at a time works fine. However, trying to add request participants one at a time does not work - only one is added. Any ideas on what could be causing this issue? I've tried the normal and the advanced JSON method but still only one participant is added.
Also, happy to hear any different ways you think this same result could be achieved. Thought of creating and array of accounts ID's and adding in bulk but I'm not sure how to do this. For whatever reason, I'm an unable to create an object.
Hi @Brandon Elie ,
Welcome to the community!
Adding request participants one by one is best done using the advanced JSON method.
There are 2 things to look out for:
If you can't get it to work, please add a screenshot of you advanced json method, so we can help debug :)
- Tessa
Hi Tessa,
Thanks for the quick reply!
I just tested it again:
Please see JSON below.
As I briefly mentioned:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi @Brandon Elie ,
I think I see the problem here.
Would it be possible to print (log) the smart value and show us what it returns?
The add will add a single user to the values already in the field, this works as expected (I have tested it.)
However, you are trying to add a list of users all at once, I am wondering if what's in your variable is in the correct format.
It should be an array of json objects looking like this:
If you already have a list, you can easily create this by doing the following:
{{yourListOfaccountIds.asJsonObject("id").asJsonArray}}
Here is the supporting doc.
Hope this helps!
- Tessa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tessa,
By design, the smart value will return one Jira account ID from the lookup table. My automation is then supposed to loop through the other "Team" selections, if any, find the corresponding ID's in the table and add them as request participants one at a time. As I mentioned, in testing only one participant is added and the rest are ignored for some reason.
I just tested the smart value again by changing my automation to post a comment of the smart value(s). I selected three teams in the form and, as expected, three comments containing an ID were posted in the issue.
I have not tried the bulk add method as I cannot think of a way to append ID values together to create an array. Happy to try this way if you have an idea how to do it?
Brandon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Brandon Elie ,
Iwasn't aware you were looping, apologies.
Before we go into creating the array, let's try to fix your loop.
If you want to edit the same field multiple times (add request participants one by one), you will probably need to "save" the issue after every add. You can do that using the "Re-fetch issue data" action.
Try that and if it doesn't work, please show a screenshot of your work, so we can debug further.
FYI, it would be cleaner to add all the participants in 1 update.
Tessa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tessa,
Thanks but that didn't work - as before, only 1 participant is added.
Please let me know how I could I create an ID array to bulk add request participants.
Regards,
Brandon
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.