Forums

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

Wanted to extract the last comment

Emil Moses November 6, 2022

Using the smart key to get the last comment Last Comment :{{issue.comments.last.body}}

 

but when  a user is tagged in the comment it extracts as user smart key ,i need the tagged  user name 

Screenshot 2022-11-06 225706.jpg Screenshot 2022-11-06 225058.jpg

1 answer

0 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.
November 6, 2022 edited

Hi @Emil Moses -- Welcome to the Atlassian Community!

That is not possible directly as the mention only contains the accountId value.  You may confirm this by writing this value to the audit log in the rule to learn how mentions are implemented:

{{issue.comments.last.body}}

 

What problem are you trying to solve by doing this?  Knowing that may help the community to offer suggestions.

 

Until then...One work-around is to call the REST API from the rule to get the user's information, including their user-name, email address, etc.

Kind regards,
Bill

Emil Moses November 6, 2022

Thanx for the reply @Bill Sheboy  i actually created a para text field last comment to extract the last comment through Automation rule, when the rule is executed it copies the last commet from the comment section to last comment field but the tagged gives me only user id.. I wanted to extract last comment to excel when i extract now it shows hi - accound id (472947325gdjurir) instead of username 

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 7, 2022

As I noted, you will need to call the REST API to do that...

Here is a now-to article on calling the REST API from a rule: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

And the method you want to call is this one: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-get

Emil Moses November 8, 2022

It looks tough and complex then i taught to get this done is there any other work around just somehow needed a name to be displayed 

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

I am not aware of other solutions; a mentioned person is represented by their accountId and inside of Jira that is all the tool needs. 

When you want to do more, you need to get the remaining user information the way Jira would: by calling the REST API function.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events