Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×I want to create a Jira automation rule. In my project, the whole team is added. My goal is that whenever someone @mentions a person in a comment, that person should automatically be added as a request participant. I have tried creating this rule multiple times, but it keeps failing. Can anybody guide me on how to set this up properly?
Hi @Shahbal Ehsan ,
first of all, welcome to the Atlassian community! 😊
I made a test automation rule, and I managed to do what you want using regex.
Here is regex to use:
{{comment.body.replaceAll("[^\[]*\[~accountid:([^\]]+)\][^\[]*", "$1,").replaceAll(",$", "")}}
in the image below, you can see first log action is full comment body without any editing, and the second log action is after regex is applied. You only get account ids.
After that just add this to variable and use variable in edit fields action to add participants.
Hope this helps.
Regards,
Benjamin
I’ve tried multiple times to create this rule, but it keeps failing. Could you please check it again?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Shahbal Ehsan , could you send me a screenshot of create variable action?
because, as I can see in your logs, first log displays whole comment body, and the second one (with regex) clearly works as it displays only accID.
So maybe you made a typo somewhere within create variable action?
here is regex once again:
{{comment.body.replaceAll("[^\[]*\[~accountid:([^\]]+)\][^\[]*", "$1,").replaceAll(",$", "")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created a new rule again — it successfully ran, but the user is still not being added as a request participant. I’ve attached the full rule screenshot for your reference so you can review it. Could you please take a look and guide me on what might be missing?
If you are available can we connect on teams for just 5 minutes ?
team id: sehsan@avanceon.ae
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see the problem from the images attached. You made a typo when you were using variable in edit work item action.
look at the image:
you misspelled variable name when using it in edit work item action: accountIDs (remove "s" a the end) and try again, it should run well.
Regards,
Benjamin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It’s still not working. After removing the ‘s’, the process seems to be stuck and continues searching without completing.
If you are available can we connect on teams for just 5 minutes ?
team id: sehsan@avanceon.ae
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
to use variable within actions, use {{}} as they mark smart value.
so you should paste {{accountID}} in that field.
after that it should work.
br,
Benjamin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Shahbal Ehsan
I hope you managed to solve the problem.
If the problem is solved, please mark this thread as closed. 😊
Regards,
Benjamin
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.