JMWE - how to mention user?

Mateusz Lisiewicz September 5, 2019

Hello. In one of my post function I need to add mention to user in comment with notification to that user. I tried to use it like that:

Comment:
@{{ issue.fields.reporter.displayName }} xxxxxx

 

but it's not working like a mention.

1 answer

1 accepted

3 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 8, 2019

Hi,

mentions in "Jira wiki markup" on the Cloud look like: [~accountId:<accountId>]. So this is what you need:

[~{{issue.fields.reporter.accountId}}]

However, note that user mentions are currently somewhat broken on Jira Cloud, at least on the "legacy issue view".

David Fischer
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 3, 2019

Actually, after a change in Jira Cloud, you now need to use this instead:

[~accountid:{{issue.fields.reporter._accountId}}]

because the only supported prefix is now "accountid:" (not "accountId:" anymore) 

Like Ricardo.Gomes likes this
Carlos Eduardo Pauperio
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!
April 1, 2022

Hi Guys,

On "How to mention a user" helps me, but if I wanna mention a team, the example below: 

asfa.png


Following the logic should be: [~teamId:XXXXXXXXXXXXXXXXXXX], but it's not working properly...

Can you help me as well?

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 1, 2022

Hi @Carlos Eduardo Pauperio 

unfortunately, there is no easy way to add a team mention. This is what Jira creates behind the scenes when you mention a Team:

[Innovalog P2 Team|https://innovalog.atlassian.net/jira/people/team/72071cab-f6ee-4f14-b29c-160f63497f3d?ref=jira$&src=issue] ([~accountid:557058:8952dfd1-85c4-493f-87d8-d383b987e05c])

As you can see, it inserts a link to the team, and then explicitly lists every member of the team as a regular user mention.

And unfortunately, Jira doesn't expose Teams through its REST API (as far as I know) so you can't even get the team members automatically. There is a way to access them through the GraphQL gateway though: https://community.atlassian.com/t5/Team-managed-projects/Working-with-Teams-in-the-Atlassian-platform-GraphQL-Gateway/td-p/1948630

However, the GraphQL gateway is not accessible from Connect apps, so you'd need to query it using the callRest Nunjucks filter and pass the valid authentication of a Jira user. Not impossible but hard.

Like Carlos Eduardo Pauperio likes this
Carlos Eduardo Pauperio
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!
April 1, 2022

Hmm i see.

The goal to mention a team is exactly to not worry about the people who are joining or leaving the team.

Hmm question, and if it is made by a group? is it possible?

Screenshot_1.png

If yes, can you show me how it's done?

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 1, 2022

Yes, with a group you can use Nunjucks to generate the mentions automatically:

{%for group in "groupname" | groupMembers %}[{{group.displayName}}|~accountid:{{group._accountId}}] {%endfor%}
Like Carlos Eduardo Pauperio likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events