Hello community,
I am using Jira JSM in my company.
I have an automation with an advanced branching, smart value.
In this branch, I use a custom field contaning a list of email addresses - email1;email2;emailX etc. For each email address, I retrieve the corresponding accountId using web request. Then I edit the Request participiants field by adding the new accountId. This works.
But, it works for 1 or 2 email addresses. For more - 3, 4, etc - I have a problem.
The automation runs properly, no error. But, this process randomly add the email addresses in the field.
E.g. If my email address list is a size of 4, sometimes the Request participants field is set with email1, email2, email3, but not the email4. Some other times, email1 and email2, email1 only, etc. Random!
Can you help me with?
Best regards,
-Rémi
This is a race condition: advanced branches edit the same field in parallel, so updates collide and some participants are lost; fix by doing a single bulk update (JSON add operations or one JSM REST call with all accountIds) instead of per-email edits inside the branch. Avoid setting the field via the basic picker in each loop; use Advanced JSON or a single Send web request after collecting all accountIds
Why this might have occured:
Branches on multiple items run in parallel with no guaranteed order, and branch changes are isolated, so concurrent edits to Request participants can overwrite each other unpredictably. This parallelism explains the “random” omissions when adding more than one or two emails in a loop
An Approach to fix the same:
Or call the JSM endpoint once to add everyone in one shot:
Endpoint: /rest/servicedeskapi/request/{{issue.key}}/participant
Thanks
Jayesh R
Hello @Jayesh Raghuvanshi
Thanks you for your reply + explanations.
Do you have time to help implement your recommendations to my automation if I provide more details (or the .json file export)?
I understand your comments. But, I don't how to do this outside the loop. As you see, I retrive the accountId in the branch.
An idea I have is to convert the string "email1;email2;email3;email4" to "accountId1;accountId2;accountId3;accountId4" and store it in a variable or a custom field. But, I don't know how to do this: concatene, cumulate the accountId in a unique variable or field.
Best regards,
-Rémi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Marc - Devoteam
Let me add details below,
1. Jira JSM, company-managed project
2. Below an extract of my automation, focusing on the part I described in my previous posts
3. And additional information about how I edit the Request participants field
4. I do not have log with interesting things to provide. Tell me more if you need a log that show specific informations.
5. "[...] where the issue is"? I do not understand this question.
Best regards,
-Rémi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rémi Chemin
Welcome to the community.
Check this KB article, add-update-remove-request-participants-using-automation-in-jsm-cloud
Also when you ask for help with an Automation Rule it will help us to help you if you provide:
1. what type of project is this (e.g., company-managed, team-managed, etc.),
2. images that show your complete rule.
3. images showing the details of any relevant actions/conditions/branches.
4. images showing the Audit Log details for the rule execution.
5. Explain where the issue is.
These questions are not for not willing to help, but to have community members understand on how automation works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rémi Chemin
This should be the JSON
{"update": {
"Request participants": [
{
"add": {"id":"{{webResponse.body.accountId}}"}
}
]
}
}
Burt this only works if the mail address specified in the custom field is already linke to an account in your instance ( even a customer has an account). If this email address is not listed yet, there is no accountID.
See the section in the link to the KB, "Copy email addresses from a Form Field to Request Participants"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Thanks you for your reply.
I already tried this. I agree, it works.
But, when the number of email addresses increase (more than 2), this solution is not stable... Read again my first message in this post.
If I have a list of email1;email2;email3;email4, so I want corresponding accountId for email[1:4] to be added to Request participiants. But, for any reason, when the automation runs, some of them are not added. I don't know if it is a timing issue in the loop.
NB: I already checked, all emails have a existing accountId in the system.
Best regards,
-Rémi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rémi Chemin
What are the details of the create variable action emailtocheck and what type is the custom field, single line or paragraph?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Marc - Devoteam
Regarding your last post,
The variable emailToCheck in my screenshots is the {{item}} from branch with trim function (to clean spaces etc).
The field is single line.
Best regards,
-Rémi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rémi Chemin
You are right. I think it's a timing issue.
If I add multiple, I get sometime 3, then 2, then 4
Are you on premium plan, you might can see if a delay action before the web request action can help.
Otherwise if this action won't help, it needs to be reported to Atlassian Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Marc - Devoteam
No, I am using Jira JSM Cloud version with standard plan.
I saw this feature Delay for Prenium plan. What a great feature! I hope a futher deploiement for standard plan too.
Do you have a solution for standard plan?
Best regards,
-Rémi
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.