Forums

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

How to add users mentioned in a comment to a custom field

Tran Ngoc Duc February 21, 2024

Hello, I am getting issue with an automation adding users mentioned in a comment to a custom field named 'Participants'. The following is the configuration of the automation:

Trigger = All comment

Then Create Variables to extract account_id in the comment

-Name:  CommentUsers

- Value: {{issue.comments.last.body.split(" ").match("(accountid:.*)]").remove("accountid:")}}

image.png

 

Then Advanced Branch: For each smart value

- Name: varAddParticipants

- Value: {{CommentUsers.split("[-,; ]")}}

 

image.png

 

Then Add action > Edit Issue field > More option > JSON

{
"update": {
"Participants": [
{
"add":{
"id":"{{varAddParticipants}}"
}
}
]
}
}

image.png

 

But if I mention 2 users, A and B, then the automation adds user A first, then removes user A, then add user B

So the actual result is only user B is added, while expected result is both user A and B are added.

Please advise how to add all users. Thank you!

 

2 answers

Tran Ngoc Duc March 18, 2025

Hi Sam, thank you. I already managed to configure the automation. It turns out that I should not use Branch. I remove Branch and it worked.

0 votes
Joseph Chung Yin
Community Champion
February 21, 2024

@Tran Ngoc Duc -

For your custom field "Participants" - What is the data type?  User picker (single user or multiple users)  or the field is just text field?  Please advise.

One idea is to update the local variable to contain all the users, and only then edit your issue's custom field.

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.

Tran Ngoc Duc February 21, 2024

Hi @Joseph Chung Yin , thanks for looking into this. the 'Participant' field is the user picker, multiple users.

Could you please help to guide me how to update the varAddParticipants to contain all the users? And which step is it? Is it before or after the Advanced Branch?

Tran Ngoc Duc March 3, 2024

Hi @Joseph Chung Yin , could you please help? Thank you!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events