Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Auto add user(s) to the Request Participant field when the user(s) is/are mentioned in a comment

Tran Ngoc Duc February 1, 2024

Hello, Can anyone advise how to configure the automation to add multiple users to the Request Participants field when they are mentioned in a comment by any one?

Our setting: We configured a Security Scheme that restrict user's access to the ticket. In details, only the following users can access and view the ticket

- Admin

- Reporter

- Approver

- Executor

- Request Participant

 

This leads to an issue that if the Executor needs someone else's help to proceed the ticket, they will mention that person(s) in a comment. And then the Admin has to add the mentioned person to the Executor or Participant manually, so that mentioned user(s) will be able to access the ticket, read comments.

 

Therefore, I want to configure an automation that add any users who are mentioned in a comment. I have found this article and tried Scenario 6 but it does not work

 https://confluence.atlassian.com/automationkb/automation-for-jira-how-to-update-the-request-participants-or-a-multi-user-picker-field-from-the-content-of-other-fields-1216971334.html#AutomationforJiraHowtoupdatetheRequestParticipantsoramultiuserpickerfieldfromthecontentofotherfields-Scenario6-AdduserstotheRequestParticipantsfieldfromacommentswhereuserswerementioned

1 answer

0 votes
Cyrille Martin
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.
February 1, 2024
Tran Ngoc Duc February 1, 2024

Hi @Cyrille Martin , thank you for looking into my issue. I already followed that article and tried the scenario 6, as I mentioned in my post, but it does not work.

 

In Scenario 6, I don't understand the JSON in Additional fields, so I copy the content to my automation. I created a test ticket and these are what I have done to test:

- Created a test ticket

- From portal, reporter mentioned user A ==> User A was auto added to the Participant

- From Jira project (not portal), user A mentioned user B in the comment

==> Expected result: User B was auto added to the Participant

==> Actual result: User B was not added to the Participant. Admin had to add user B manually

 

Cyrille Martin
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.
February 1, 2024

The JSON is splitting the comment by the character separating the user mentions. In the exemple - ; and ,

If in your case you just have one user mentioned, you can remove the split function and then you will have the user mentioned

Tran Ngoc Duc February 1, 2024

Oh, thank you, this is my updated JSON

 

{
"update": {
"Participants": [
{{#issue.comment.last.body.substringAfterLast("[~").substringBeforeLast("]")}}{"add": {"name":"{{.}}"}}{{^last}},{{/}}{{/}}
]
}
}

 

If the comment is: "I do not have permission to grant access. Hi @Cyrille Martin , could you help?" 

Then will the JSON work? I am not sure if the user's name mentioned is in this format [~julien1]

Cyrille Martin
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.
February 1, 2024

Your JSON should work.

The format with the square bracket is used for DC for sure.

Suggest an answer

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

Atlassian Community Events