Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,983
Community Members
 
Community Events
184
Community Groups

Automation: How to @mention user in Add Comment action?

Hi!

I'm currently using the cloud version of Jira Service Desk and was trying to set up an automation rule for when status changed (this is the trigger). When a request is transitioned to a specific status (e.g., Awaiting Implementation), I want to Add Comment and @mention specific users so they're aware that this request is ready for them. However, it keeps telling me no users found.

I've already made sure that the rule's running user has the Browse users and groups permission. The interesting thing is that @mention works in the Alert User action (this could be a solution, but it's not ideal because I can't customize the alert message).

Does anyone know if I'm doing something wrong or didn't set something correctly? Or is this a known issue with Add Comment? If so, what's the workaround, besides getting a plugin (it just seems silly to me that I have to purchase a plugin to perform such basic/native functionality)?

13 answers

1 accepted

7 votes
Answer accepted

Hello,

 

Just an accidental find while messing around that actually works. 

 

Step 1: Find the internal username

Go to any workflow and edit it. Go to create transition and add a Post Function.

At the Post Function page, pick Update Issue Field.

Choose Issue Field Assignee and pick the third option (start typing...)

Start typing the desired user. Find him/her and click.

What is written in the field after the click is some kind of internal username.

If there is an easier way to find out this username, please, let me know.

 

Step 2: Add the internal username to the comment exactly as [~internal-username]

 

Step 3: Click preview...

I would like to say that as of Jira 8.5.3. This no longer appears to work.  It used to work but we just got alerted that the users being tagged are no longer receiving emails from our postfuntion doing this

Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 21, 2020

The best way I have found is to go to a user's profile page, get their ID, and reference them in the action like this:

[~accountid:ACCOUNT-ID-HERE] do a thing
Like # people like this
[~accountid:ACCOUNT-ID-HERE] do a thing

works as of April 2023. Thanks Jon

This works for me:

[~accountid:{{comment.author.accountId}}]

Thanks! It definitely works!

This did not work for me - it simply resolves to "User" or "Former User" depending on the browser - I cannot get this to work correctly. I'm trying to @ a watcher or another user, but nothing works. Not even the assignee.

Like # people like this

Me too, it links to UNKOWN_USER

me too.. links to UNKNOWN_USER

Be sure that you are asking the smart value for the correct context. In my case I needed the issue assignee for the card and not the comment author. Below are a few examples:

[~accountid:{{comment.author.accountId}}]
[~accountid:{{issue.assignee.accountId}}] 
[~accountid:{{issue.reporter.accountId}}] 

If you are wanting to use a static @ for a user that is not within context of the issue/comment you can do so by looking and passing their user hash. To do this simply click on the name of the user in any issue or comment to go to their profile.

You will see a url similar to: https://company.jira.com/people/687614:8ffcb0ed-ddbd-4688-8635-c76146f483. Given this link example your @ would look like:

[~accountId:687614:8ffcb0ed-ddbd-4688-8635-c76146f483]

Like # people like this
Like Miftah Farid likes this

Many thanks Aaron.

However I have two rules and are triggering at the same time on the same ticket, yet they have different conditions.

I don't think the .accountId is necessary. In my tests, both tag users successfully:

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

Before finding this thread I was trying just @{{assignee}} which ended up looking like @60dd74cbad9bba006a9c1a8b in the comment (which after checking is the account ID.

Like Miftah Farid likes this

Be sure that you are asking the smart value for the correct context. In my case I needed the issue assignee for the card and not the comment author. Below are a few examples:

[~accountid:{{comment.author.accountId}}]
[~accountid:{{issue.assignee.accountId}}] 
[~accountid:{{issue.reporter.accountId}}] 

If you are wanting to use a static @ for a user that is not within context of the issue/comment you can do so by looking and passing their user hash. To do this simply click on the name of the user in any issue or comment to go to their profile.

You will see a url similar to: https://company.jira.com/people/687614:8ffcb0ed-ddbd-4688-8635-c76146f483. Given this link example your @ would look like:

[~accountId:687614:8ffcb0ed-ddbd-4688-8635-c76146f483]

This- 

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

Was exactly what I needed, thanks! 

Like João Paiva likes this

This markdown format with hardcoded numerical account ID ([~accountId:687614...]) also appears to work in replies to Jira notification emails.

The reply body becomes a Comment on the Jira issue, and the markdown account ID is correctly rendered as an @ mention (as though you had commented on the issue directly).  The @ mention will notify the user as expected (per their notification settings).

This- 

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

Was exactly what I needed too!

Hello everybody,

in case anyone is wondering and stuck the same as i was. The solution for JIRA SERVER which works for  Jira Project automation is using this:

E.g.

[~{{reporter.name}}]

[~{{assignee.name}}]

 

Clickable link to user profile/mention is placed in the comment :)

God bless you, your children and your children's children.

@[~accountid:{{worklog.updateAuthor.accountID}}] is how I solved it for Cloud when trying to mention the last person to log time on an issue.

@Christos Zachos Thanks for your comment, I have just tested this and your suggestion works!

When setting up the automated comment, I just needed to add [~olivia.morris] in the comment section. (the @ mention function doesn't work, it "can't find the user")

This means I can now skim through email notifications and see the update on them, without needing to click into every ticket to see why I have been notified. 

 

1. EDITING THE AUTOMATED COMMENT

Screenshot 2019-05-24 at 11.52.32 am.png

2. PREVIEWING THE AUTOMATED TICKET

Jira automated comment mentioning user solution 1.png

3. AUTOMATED EMAIL NOTIFICATION, WITH COMMENT (EXAMPLE)

Jira automated comment mentioning user solution 2.png

 

Thanks!

1 vote
BurakK
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!
Mar 17, 2023

I'm using Jira Cloud and I would be able to tag creator and reporter with these two: 

[~accountid:{{issue.reporter.accountId}}] ->  Works for tagging Reporter

[~accountid:{{issue.creator.accountId}}] ->  Works for tagging Creator

1 vote
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 17, 2019

@wa1_kh00, to be clear are you saying the users you are trying to mention are either agents for the project or they are say Jira SW licensed users that are in a group that has Browse and Add Comments permission? Assuming this is the case then they should show when you click Comment and @mention them. I would ask one of the users to verify that they can view and comment on an issue.

@Jack Brickey In this case, they're agents (they're also Jira SW licensed users as well).

Well, if I were to manually comment on a request, I can @mention them. But not so in automation rules, specifically the Add Comment action.

Like Mark Hostetler likes this
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 17, 2019

ah, my bad. was not thinking about automation. I have never attempted that but expect it is not possible. maybe others have different thoughts here.

No worries! It's helpful to cross-check.

It would suck if it's not possible...love to hear what others have to say.

For Jira DC you can static comment/tag a user in the comments with [~username]

*replacing username with their Jira username

Hello , you just need this logic in the comment, you need to call the email of the user.

(For DATACENTER)

[~{{user.emailAddress}}]

If you want to mention for instance automatically the reporter:
[~{{reporter.emailAddress}}]

Or the assignee maybe:
[~{{assignee.emailAddress}}]

And so on....

For Jira Software Cloud, I tried this- [{{ currentUser | userInfo("displayName") }}|~accountid:{{ currentUser._accountId }}] 

This allowed me to successfully run a post function that mentions the current user of the issue.

i 've tried this , but no works,  still the field by default assigned to  

autoassign.jpg

@Tasneem Abdelhamid Are you trying to update the field assigned or mention them? Your screen shot is assigning a field, but this question is addressing users for messaging within text fields.

Screenshot 2019-05-15 at 3.08.38 pm.pngI also experience the exact same thing! 

 

I want to be able to post an internal comment, @'ing myself, when certain triggers occur, so that I get an email saying "@olivia, the SLA is about to breach" etc however i can't seem to be able to @ mention myself in the automated comment function. 

 

You can "alert" a user, but that just sends me an email saying "This ticket requires your attention", with no context to why. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events