Forums

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

how to get array of mentioned users on jira comment using smart values

shannon(박기옥)
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2020

i'd like to send push alert to mentioned users by sending web hook service 

so i need to get array of mentioned users on jira comment using smart values.

i attached image for these but it dosn't work. 

how can i do?

 

스크린샷 2020-08-22 오전 9.35.51.png

2 answers

0 votes
K. Yamamoto
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 11, 2021

Hi Shannon - I found there's no straightforward way to achieve your requirement.

Consider voting for the feature request tracked at JRACLOUD-77167.

0 votes
Florian
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.
August 22, 2020

I think the problem is that regex is greedy (google regex greedy). This means when you have more than on @-mention of when there is a closing ] after the first user name your match will expand up to the last the last ]. 

I think there is no way to collect the user from a smart value as the documentation only lists these 

{{comment.body}}
{{comment.author}}
{{comment.created}}
{{comment.visibility.type}} - comment restriction type, if any e.g. role
{{comment.visibility.value}} - comment restriction label, if any  e.g. Developers 
{{comment.internal}} - for Jira Service Desk comments, returns false if the comment is visible to customers.
{{comment.properties}} - Way to access any comment property. Properties are frequently used by add-ons and integrations to store values.
{{comment.properties."sd.public.comment".internal}}
{{comment.id}} - Used by triggers that involve adding a comment, such as Issue commented, Issue transitioned, or Issue updated. The comment that triggers the rule is stored in this smart value.

What you can try is to send the whole comment to an intermediate web service (where you have full control and can add you own source code I a full featured  programming language). This intermediate service can then parse the comment and relay it to the recipients you want. 

Suggest an answer

Log in or Sign up to answer