Mention users in automation comment

Gui Ávila October 25, 2020


Hi,


I created an automation to comment an issue when status changes to "Reopen". I used smart values for users: https://support.atlassian.com/jira-software-cloud/docs/smart-values-users/

But the end result is a plain text comment. How can I actually mention those users, so they are notified as well?


Thanks!

 

Gui.

5 answers

1 accepted

0 votes
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2020

Hi GUI - can you share the rule you have so far?

Gui Ávila October 28, 2020

@John Funk Yes, sure. 

This is the rule.

:)

Like Antonio García likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 28, 2020

There is nothing here. 

Gui Ávila October 28, 2020

@John Funk Sorry, wrong link.

Here the image.

This is the message that appear as a new comment:

{{reporter.displayName}} e {{assignee.displayName}}, essa issue foi reaberta por {{initiator.displayName}}.
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 28, 2020

Try this for the text to show up:

{{issue.reporter.displayName}} and {{issue.assignee.displayName}}

Then send and email to the reporter and assignee. 

Like # people like this
Gui Ávila October 28, 2020

Sorry @John Funk , I did not understand.

Send an email? What I am trying to do is to create an automatic comment that mentions the user, so they are notified. The comment created via automation is currently in plain text. The mention does not work.

Thanks!

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 28, 2020

That is why you can send an email in the same rule so that they are notified - it does not have to be a mention for an email to go. 

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.
October 28, 2020

Hi there,

To mention from a comment, please try:

[~accountid:{{issue.assignee.accountId}}]

If you need to mention a specific person, you will need their id value, which you can get from performing a search or looking at their profile info.

[~accountid:thePersonsIdNumber]

 

Best regards,

Bill

Like # people like this
Gui Ávila November 3, 2020

@John Funk But users see notifications inside Jira application, not on email. What I am trying to avoid is sending emails for Jira notifications. That's why I am trying to mention users in comments...

Like # people like this
Gui Ávila November 3, 2020

@Bill Sheboy Wow, that is really complicated. If we are commenting an issue and using smart values for user names, shouldn't Jira mention those users? 


Am I missing something here, or this does not make sense?

Like Matthew_Kent 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.
November 3, 2020

Hi @Gui Ávila 

Well...That is how I know to use smart values perform a mention at this time.  I would welcome any guidance if someone has found a simpler way to do this from the automation rules.

Remember that when we are inside a rule, we don't have the intellisense/type-ahead search to find a user (as when typing in a comment directly).  We need to reference a dynamically changing user identity from either the fields in the issue, or hard-coded.

__Bill

Like # people like this
Gui Ávila December 9, 2020

@John Funk Sorry, I forgot do reply.

Worked perfectly. Thanks a lot, again!

Like John Funk likes this
Gui Ávila December 9, 2020

@Bill Sheboy Thanks, it worked!

Like # people like this
Paula Manildi February 10, 2021

Help! I can't see that / how you solved this. I want to mention a user (which I can do with issuefields) but it needs to be a mention so that it notifies the user they need to see the issue. Also it needs the key (as a link) in the email notification. Tried using email but then it comes from 'automation for jira' instead of jira and just confuses the user. 

Currenly using: {{issue.fields.Manager.displayName}} This travel request {{issue.key}} for {{reporter.displayName}} needs your approval

but it isn't a mention.  I can't grab their actual id value in a rule.

Gui Ávila February 11, 2021

Hey @Paula Manildi ,

@Bill Sheboy Said above how to do it:

 

Hi there,

To mention from a comment, please try:

[~accountid:{{issue.assignee.accountId}}]

If you need to mention a specific person, you will need their id value, which you can get from performing a search or looking at their profile info.

[~accountid:thePersonsIdNumber]

 

Best regards,

Bill

 

:)

Like John Funk likes this
Paula Manildi February 11, 2021

Thanks, it got lost in the noise! Using this worked!

[~accountid:{{issue.fields.Manager.accountId}}]  This travel request {{issue.key}} for {{reporter.displayName}} needs your approval

Like # people like this
Gui Ávila February 12, 2021

Awesome! @Paula Manildi 

Paul Campbell February 9, 2022

I have this working: [~accountid:{{issue.assignee.accountId}}]

And this working: [~accountid:thePersonsIdNumber]
to tag an individual

How does one tag a group in a comment?

I have tried:
[~groupid:<GroupID>]
and
[~group:<GroupID>]

and
[~groups:<GroupID>]

each fail

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.
February 9, 2022

Hi @Paul Campbell 

Mentioning a group is not possible yet, and here is the suggestion to add that feature: https://jira.atlassian.com/browse/JRACLOUD-75999

Two possible work-arounds, one more brittle and one slower:

  1. hard-code the list of values (either in the rule or an entity property) and iterate over it to create the mentions
  2. use the REST API to gather the members of the group and iterate over them to create the mentions

Kind regards,
Bill

Like John Funk likes this
Michael Davison April 15, 2022

For me,  [~accountid:{{issue.assignee.accountId}}] looks like it has mentioned someone in the comment - that is, the user name gets markup that looks like they've been mentioned in a comment, but there still is no email notification to the user that they've been mentioned in a comment like there would be if I had "@" someone manually.

For example, this comment was posted successfully using [~accountid:{{issue.assignee.accountId}}] from an automations rule, but I never got any indication that I was mentioned, either by email, or in Jira: Screen Shot 2022-04-15 at 9.31.51 AM.png

But if select and copy the comment that Automation for Jira posts, and re-post it in the comments section manually I will get a notification

Is anyone actually getting the "you were mentioned" emails like the below, when it is an automated comment post? I can't figure out why I don't get them. The whole point of commenting with an @ is so the user will be alerted... Screen Shot 2022-04-15 at 9.38.37 AM.png

Any assistance is appreciated.

Rahul Jith December 8, 2022

Heloo @Bill Sheboy 

Hope you are doing well!

That's really a helpful solution as u always does and one of my complications got sorted. thanks Bill.

Another place I am still stuck where I was trying to send a teams message using incoming webhook.

all smartvalues I am successful able to reflect in the teams notification via automation but I'm missing the mention user part. I have tried with [~accountId : user account id] and the message in teams is coming as  [~accountId : 133ghdjshjsjsjj].

The account Id person does not belongs to that issue accountable nor in the watchlist but exist in jira and added in same project.

 

My intention is to send a notification to set of people wen there is any changes to fix version.. these people are in jira however they are not part of the issue. 

A solution or suggestion would be a great helIMG_20221208_181308.jpgIMG_20221208_182444.jpg

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.
December 8, 2022

Hi @Rahul Jith 

That is not possible yet, as you can see in this suggestion: https://codebarrel.atlassian.net/browse/AUT-1694

The challenge is the same as for Slack mentions: the different tools have different user accounts, and so you would need access to the user information in the destination tool: MS Teams.

The work-around for Slack mentions is to replicate the Slack user ids in Jira, such as with entity properties for each user.  I have not tried this before with Teams, so I do not know if that is possible.

Kind regards,
Bill

Ben Gallant April 18, 2023

See my added comment below. I hope it helps!

We wanted to add a comment to an issue to @mention the user who transitioned the issue to a different status. This required us to mention the initiator of the action. Here's how we did it: 

[~accountid:{{initiator.accountId}}]

This generated the correct @mention, adding a nice Jira bell notification. 

Like # people like this
Magdalena Zhisheva
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.
May 22, 2023

Thank you @Ben Gallant :) 

Stefan Draber June 5, 2023

Hi @Michael Davison

did you get your issue solved? I'm stumbling upon the same thing: when I'm getting mentioned by Automation, I neither get a mail- nor a Jira-notification, however I have notifications generally enabled when being mentioned.

My current workaround is to also send a mail to the mentioned person via automation along with the comment, but that's kind of ugly obviously ;)

Best regards,

Stefan

Stefan Draber June 6, 2023

Hi @Michael Davison and others,

I managed to solve my issue and wanted to share my findings:

The missing mention-notification was caused by my individual notification-setting, that I don't want to be notified about own changes on a ticket.

When somebody else triggered the mention-automation, the notification was sent via mail and also in Jira (notification bell). This worked both with the Automation-user and any random other human user as automation-actor.

Best regards,

Stefan

Like Magdalena Zhisheva likes this
Younes Abou Khzam July 21, 2023

hello,

 

@mentioning with [~accountid:{{user_account_id}}] is not working, automation only puts this out when i create the issue:

[~accountid:]

 

Any help would be greatly appreciated here :)

Stefan Draber July 21, 2023

Hi @Younes Abou Khzam 

within the {{ }} you have to insert a smart value. Your value user_account_id is not a smart value.

Here you can find an overview of smart values for users: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-users/

For example, if you want to mention the creator of a ticket, it would be

[~accountid:{{creator.accountId}}]

 If you have a custom user picker field, you have to address this field like

[~accountid:{{customfield_10255.accountId}}]
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.
July 21, 2023

Hi @Younes Abou Khzam -- Welcome to the Atlassian Community!

That smart value you are using appears incorrect. 

User fields (such as reporter) have an attribute named accountId, and so to reference it you would use {{issue.reporter.accountId}}

Please post images of your entire rule and the audit log details showing the rule execution.  Those will provide context for the community to suggest how to help.  Thanks!

Kind regards,
Bill

Younes Abou Khzam July 24, 2023

Hello, 

 

@Stefan Draber you were right, I used the {{}} (smart value) operators where i should have added the user account ID without them, and it worked! Thank you!

Looking forward to the release of the @mentioning teams in automation feature!

Like Stefan Draber likes this
2 votes
Ben Gallant April 18, 2023

To add onto this:

We wanted to add a comment to an issue to @mention the user who transitioned the issue to a different status. This required us to mention the initiator of the action. Here's how we did it: 

[~accountid:{{initiator.accountId}}]

This generated the correct @mention, adding a nice Jira bell notification. 

Mate Moldovan December 8, 2023

This works like a charm! Thank you Ben!

Magdalena Zhisheva
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.
January 15, 2024

Thank you, Ben!

Joshua Bertaut January 19, 2024

Perfect thank you! Also not sure if it has been mentioned. To @ comment the reporter i used:

 

[~accountid:{{reporter.accountId}}] 

0 votes
Collista Lewingdon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 30, 2024

@Ben Gallant Thank you, your answer solved my question. 

 

0 votes
Alex Ziegltrum August 2, 2023

That is cool stuff @Bill Sheboy and John Funk! 👍

with [~accountid:{{fieldChange.from}}] you can mention the user in a rule, that monitors the change of an assignee to not be empty.

2023-08-02 19_45_15-Jira Configuration - Jira und 5 weitere Seiten - Geschäftlich – Microsoft​ Edge.png

0 votes
Karthika Murugesan May 4, 2023

Hi, does anyone know how to tag multiple watchers in the comment through Automation? Thanks in advance

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.
May 4, 2023

Hi @Karthika Murugesan 

You could iterate over the Watchers field to add each one as a mention, as described in this thread.

However...If they are already watchers, why would you want to do this?

Kind regards,
Bill

Like Věra Fládrová likes this

Suggest an answer

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

Atlassian Community Events