Mentioning multiple users from a user picker field through automation

katie.kurty June 28, 2021

Hi,

I'm trying to tag or mention multiple users in an auto comment through automation rule. I created a custom field user picker of 'Code Reviewer(s)' and I want to tag all the users in that field in a comment.

For example:
"[~accountid:{{Code.Reviewer(s).accountId}}] this ticket is ready to be re-reviewed."

I've tried all these variations but nothing has worked:

  • [~accountid:{{Code.Reviewer(s).accountId}}]
  • [~accountid:{{Code Reviewer(s).accountId}}]
  • [~accountid:{{Code.Reviewer.displayName}}]

Is this possible?

1 answer

2 votes
Bill Sheboy
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.
June 28, 2021

Hi @katie.kurty 

Have you tried treating your custom field as a list?  Perhaps something like this in the comment:

{{#issue."Code Reviewer(s)"}}
- [~accountid:{{accountId}}]
{{/}}

Please consider first writing to the audit log until you get your custom field name's smart value correct, and this should work.

If you have trouble getting the correct smart value, consider using the custom field number ID instead for "Code Reviewer(s)", which you can find using the method described in this how-to documentation: https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/

Best regards,

Bill

katie.kurty June 28, 2021

Thanks Bill!

I'm sorry, I'm a little confused about what you are saying. I tried using what you wrote :

{{#issue."Code Reviewer(s)"}}
- [~accountid:{{accountId}}]
{{/}} This ticket is ready to be re-reviewed.

but only the comment displayed. Should I continue to play around with how "Code Reviewer(s)" is written? I also tried finding the custom field number ID by using Inspect but didn't see one displayed. 

Any further help would be great!

Thanks!

Katie

Like felix.weber likes this
Bill Sheboy
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.
June 29, 2021

Hi, Katie.

Sometimes the key for automation and custom fields is finding the smart value.  Let's try this: use the log action to write just the field to the log, such as one of the following:

{{issue.Code Reviewers(s)}}

{{issue.code reviewers(s)}}

{{issue."Code Reviewers(s)"}}

If one of those works, substitute that into the example I provided. 

If not, please chat with your site admin to learn the custom id number for your field.  Then instead try this, substituting in the custom field number:

{{issue.customfield_12345}}

Once you get that to work, you can substitute it into:

{{#issue.customfield_12345}}
- [~accountid:{{accountId}}]
{{/}}
This ticket is ready to be re-reviewed.
Like # people like this

Suggest an answer

Log in or Sign up to answer