I have an automation rule that receives a payload from an external system.
Example payload is as below-
"payload": {
"eventName": "add_update_shipment_info",
"version": "2.0",
"opportunityName": "abc-34514",
"shipment_name": "WH/OUT/abc-34514/1",
"shipment_id": "473397",
"shipment_url": "https://www.xyz.com",
"shipment_status": "Planned",
"committed_ship_date": "2025-10-14T09:30:00Z",
"planned_ship_date": "2025-10-14T09:30:00Z",
"actual_ship_date": null,
"committed_pickup_date": "2025-10-14T10:00:00Z",
"planned_pickup_date": "2025-10-14T10:00:00Z",
"actual_pickup_date": null,
"committed_delivery_date": "2025-10-22T03:45:00Z",
"planned_delivery_date": "2025-10-22T03:45:00Z",
"actual_delivery_date": null,
"tracking_info": {
"carrier": null,
"shipping_method": null,
"shipment_source": null,
"tracking_code": null,
"tracking_url": null,
"number_of_boxes": null,
"delivery_status": null,
"signed_by": null
},
"mfg_dris": [
{
"platform_user_id": 68549,
"email": "priyanka.agrawal@xyz.com",
"first_name": "Priyanka",
"last_name": "Agrawal"
},
{
"platform_user_id": 68550,
"email": "abc.def@xyz.com",
"first_name": "abc",
"last_name": "def"
},
{
"platform_user_id": 68551,
"email": "api-jira@xyz.com",
"first_name": "API",
"last_name": "Jira"
},
{
"platform_user_id": 68553,
"email": "api-auto@xyz.com",
"first_name": "api",
"last_name": "auto"
}
]
}
}
The payload contains multiple email addresses under mfg_dris.
I need to tag all these users in an issue (created after the branch) in a custom field called MFG-DRI, which is a multi-user field.
I'm successfully fetching the account IDs for each email address via the Jira REST API by looping over each email address from the payload and storing them in a variable.
However, I'm unable to access or use that variable outside the branch in order to update the custom field on the issue.
I've tried several approaches, such as:
- Initialising the variable before the branch
- Creating the issue first and then updating it using the account IDs via the Update Issue API
…but none of these methods have worked so far.
Could anyone suggest the correct way to use the variable (containing the account IDs) outside the branch so I can populate the MFG-DRI field on the issue?
Another approach I tried is:
1. Create the issue first and then fetch the account IDs inside a branch by looping over each email address from the payload.
2. Store the account IDs in a text custom field.
3. Use "Update issue" API to update MFG-DRI field on the newly created issue by copying values from the text custom field on step 2.
But, this solution causes parallel race condition i.e. multiple automation actions run at the same time to update the same issue, and they overwrite each other or run in the wrong order) when there are more email addresses (I tried for 4 email addresses).
See screenshot for the automation I tried:
and here is what I mean by parallel race condition:
Please suggest if you know a way to tag all the email addresses from the payload to a multi user field. The count of email addresses may vary in the payloads.
It seems you create the useraccountIDs variable inside the branch. That means that every time that an mfg is processed, this variable is re-made from scratch, so it loses the prior content.
Creating this variable before entering this branch would be beneficial.
Kind regards,
Dick
Without seeing your entire rule for context...this is not possible as you described it.
Rule branches on more that one thing are run in parallel and asynchronously with no guarantee of when the branch will complete up until the last step of the rule. Thus, a variable cannot be created before, updated during, and used after the branch. (There is an edge case when a branch can only possibly have one thing, such as for branch on current issue.)
Although a multiple-select user field may be set to a single value using an email address, it cannot take a list of addresses (based on my testing). And neither can a JSON accept email addresses for an update.
And, after the privacy changes from a few years ago, I do not believe it is possible to bulk-get users with their email addresses to perform a single get-users, filter by email address, and update of the user field.
There is a brittle workaround with a two-rule approach, where one is recursive using an Incoming Webhook Trigger, but I would not recommend it for this scenario. And, it is limited to up to 10 loops, and subject to problems if Atlassian has an outage impacting rule execution.
Some other workarounds are:
Kind regards,
Bill
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.