Forums

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

Mention user group using Jira Automation without using teams

mb
Contributor
July 22, 2022

Hello,

I am trying to create a Jira Automation rule that does the following:

Check if a user group has been mentioned in a new comment e.g. 

@10-Company.Accounting

Add a new comment that mentions the user(s) contained in the group

 

This is how I am trying to achieve this:

2022-07-22_16h15_08.png

I successfully check for

@([0-9]{2}-\w+\.\w+)

And then try to comment:

{{issue.comments.last.author.displayName}} mentioned the following users {{membersOf("{{comment.body.match("@([0-9]{2}-\w+\.\w+)")}}")}}

I have also tried omitting the curly braces inside:

{{issue.comments.last.author.displayName}} mentioned the following users {{membersOf("comment.body.match("@([0-9]{2}-\w+\.\w+)")")}}

What's wrong?

This successfully returns the mentioned group name.

{{comment.body.match("@([0-9]{2}-\w+\.\w+)")}}

Could anyone help me please?

I have found 2 issues with this:

  1. How do I get an array of users in a group using Automation for Jira and reference to the users? -> membersOf() does not work because it only works in combination with Assignee, Reporter, Voter, Watcher, Creator, custom fields of type User, e.g. assignee in membersOf("10-Company.Accounting")
    -> Maybe there is a different JQL / smart value that does the job?
  2. How do I mention multiple users? (Possibly by using [~accountid:{{}}] in combination with an iteration)

 

This is the error message I got:

Error rendering smart-values when executing this rule:
Failed to get value for membersOf("{{comment.body.match("@([0-9]{2}-\w+\.\w+)"): {{issue.comments.last.author.displayName}} mentioned the following users {{membersOf("{{comment.body.match("@([0-9]{2}-\w+\.\w+)")}}")}}

And without the curly braces inside:

Failed to get value for membersOf("comment.body.match("@([0-9]{2}-\w+\.\w+)")"): {{issue.comments.last.author.displayName}} mentioned the following users {{membersOf("comment.body.match("@([0-9]{2}-\w+\.\w+)")")}}

I have seen this issue, but I am trying to find a workaround until it is implemented:

https://jira.atlassian.com/browse/JRACLOUD-28225

Thank you.

0 answers

Suggest an answer

Log in or Sign up to answer