Forums

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

Need automation to update a field with a comment and get the DisplayName, not ID of a mention?

Cash Coyne
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 12, 2023

How can I use automation to update a field with a comment and get the text name, not ID of someone mentioned in the comment using the "@" function to reference someone.  I'm not talking about the person making the comment, I'm talking about a person (or persons) who was mentioned in the body of the comment

I have an Automation Rule which populates a Custom Field called LastComment with the msart value of {{issue.comments.last}}. 

This works fine, except that when someone is mentioned in the comment, it shows up something like this: [~accountid:70121:76e8071e-e445-4674-b7a3-e17c64eb6757] in my custom field LastComment

Is there a way that I can get that mentioned person to have their name shown, not their ID?

2 answers

1 accepted

0 votes
Answer accepted
Alex Koxaras _Relational_
Community Champion
January 12, 2023

Hi @Cash Coyne 

Can you try {{issue.comments.body.last}} on your field and let me know the outcome? I've tried it on my instance and the result I have is to copy the last comment exactly as is. I mean e.g.:

Comment: "Hi @Cash Coyne please check this out!"

Then using the  {{issue.comments.body.last}} on a multi line text field will be the exact same text/comment: "Hi @Cash Coyne please check this out!"

What type is your field? Text?

Alex Koxaras _Relational_
Community Champion
January 12, 2023

And another thing you could do is to get the person's id from a smart value, using the following {{issue.comments.last.body.substringBetween("[~accountid:","]")}}, and use it on a user field. Then re-fetch the data and then copying  the new user field onto your text field. But this would increase the processing time of your rule to approximately 4-5 secs. Which is a lot.

Cash Coyne
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 12, 2023

That worked.  THanks @Alex Koxaras _Relational_ !

Alex Koxaras _Relational_
Community Champion
January 12, 2023

Good to know that!

0 votes
Vamsi Kandala
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 12, 2023

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events