Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation to add multiple request participants from assets

Gerrit Wahlers
Contributor
March 5, 2025

If a user creates a ticket and chooses a department, all department managers should be added as request participants.

1 department can contain up to 5 employees in the attribute "manager". (1:n)

Every employee has one linked jira user in the attribute "Jira User". (1:1)

For a single manager, this "edit issue" step is working, but if a department has multiple Managers, i get the error "Inactive User". It seems the syntax of the list is wrong.

I use the edit issue-function with this JSON:

{
"update":{
"Request participants" :[
{
"add": {
"id":"{{#issue.customfield_10294.Manager}}{{Jira User.ID}}{{^last}}, {{/}}{{/}}"
}
}
]
}
}

2 answers

0 votes
Stephen_Lugton
Community Champion
March 5, 2025

Hi @Gerrit Wahlers 

Probably a silly question, but have you checked to make sure that one of the managers you're trying to add isn't actually an inactive user?

Gerrit Wahlers
Contributor
March 5, 2025

All manager´s Jira Users are active. I checked it more than one time.

My guess is that he tries to put in the user [User-ID1, User-ID2, User-ID3] instead of (maybe) [User-ID1],[User-ID2],[User-ID3].

Gerrit Wahlers
Contributor
March 5, 2025

We can add them all manually.

Stephen_Lugton
Community Champion
March 6, 2025

Have you tried using log action or a comment to see what the smart value {{#issue.customfield_10294.Manager}}{{Jira User.ID}}{{^last}}, {{/}}{{/}} is returning?

Gerrit Wahlers
Contributor
March 12, 2025

The protocol-action {{#issue.customfield_10294.Manager}}{{Jira User.ID}}{{^last}}, {{/}}{{/}}

gives me for departments with multiple managers this result:
5ecd094edacdxxxx1f893d3e, 712020:587a58ad-dfc5-40ba-xxxx-9b3796523801

and for a department with a single manager this result:
712020:587a58ad-dfc5-40ba-xxxx-9b3796523801

Then, i have this update issue command:

{
"update": {
"customfield_10026": [
{{#issue.customfield_10294.Manager}}
{ "add": { "id": "{{Jira User.ID}}"}}{{^last}}, {{/}}
{{/}}
]
}
}

All departments with a single manager everything works fine. But if a department has multiple managers i got this error: 

GER: Geben Sie einen gültigen Wert für "customfield_10026" an (customfield_10026))
ENG: Enter a valid value for “customfield_10026” (customfield_10026))

Gerrit Wahlers
Contributor
March 12, 2025

The funny thing is, if i put all department-managers in a smart value (Branch) (#departmentmanagers = {{issue.customfield_10294.Manager}}) and use this command:

{
"update": {
"customfield_10026": [
{{#departmentmanagers}}
{ "add": { "id": "{{Jira User.ID}}" }}{{^last}}, {{/last}}
{{/departmentmanagers}}
]
}
}

all departments with multiple managers works fine, but not with a single manger.

Stephen_Lugton
Community Champion
March 12, 2025

Maybe just do an IF / ELSE for One / More than one manager, and use the code that works for just one manager in the IF and use the smart value branch in the ELSE

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 12, 2025

Hi @Gerrit Wahlers 

My understanding is asset data is looked up just-in-time, and the Edit Issue action with JSON can have timing problems by parsing too quickly...leading to missing data and errors.

 

The solution for this is to first build that JSON expression and save it in a Created Variable, perhaps named varJson.  This will lookup and fully evaluate the expression before it is needed.

Then use the variable as the JSON in the advanced edit as:

 {{varJson}}

 

Kind regards,
Bill

Like Stephen_Lugton likes this
0 votes
Gerrit Wahlers
Contributor
March 5, 2025

I tried this, but it does not help either:

{"update": {
"Request participants": [
{{#issue.customfield_10294.Manager}}{"add": {"id":"{{Jira User.ID}}"}}{{^last}},{{/}}{{/}}
]
}
}

Source: Add/Update/Remove Request Participants using Automation | Jira | Atlassian Documentation

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events