Forums

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

sending a comment with user name via automation email, renders the user id, not their name

Ben
Contributor
October 21, 2021

Hi,

in the scenario, im sending out an email via automation  that contains the last comment on the issue. the comment may include a user mention.

when the email is sent, instead  of the display name of the user mention, it sends their ID.

i cant use a smart value, since i cant expect when the comment will/not contain a user. 

 

any advice?

4 answers

2 votes
John Funk
Community Champion
October 22, 2021

Hi Ben,

Try adding .displayName after the field name. 

For example {{issue.Reporter.displayName}}

John Funk
Community Champion
January 9, 2022

Hey @Ben  - Any update here?

1 vote
Belen Rubalcaba January 7, 2022

Hello, I have exactly the same problem as Ben. Here is a screenshot of my rule:

auto_jira.png

 

When the issue comment contains a user mention, the email shows the user account ID, rather than the user name. Is there a workaround for this?

Belén

John Funk
Community Champion
January 9, 2022

Hi Belén,

So, what is the result when you run it?

Belen Rubalcaba January 10, 2022

Here is the email that get sent. See the red account ID instead off the user mention:

auto_jira_2.png

John Funk
Community Champion
January 12, 2022

So it looks like it is including the name as it should. But it just also includes the account id of the user. Is that the only problem? 

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.
January 12, 2022

Hi @Belen Rubalcaba 

This appears to be the expected behavior; there is a suggestion to improve this, which you may vote for/watch to see progress: https://jira.atlassian.com/browse/JRACLOUD-77167

A possible work-around would be to extract/replace mentioned accountId values for displayNames using a call to the REST API...although that might only help with a single mention.

Kind regards,
Bill

Like John Funk likes this
Belen Rubalcaba January 13, 2022

Hello John Funk,

Nope, the user mentioned is replaced by the account ID, so one cannot see who the mentioned user was. In my screenshot, the blurred out name is the last comment author, not the user mention.

Hello Bill Sheboy.

Thank you for the reference to https://jira.atlassian.com/browse/JRACLOUD-77167, I will check and vote for this enhancement.

Regards.

Belén

Like Bill Sheboy likes this
0 votes
AJohnston
Contributor
May 20, 2025

In case anyone else is looking for this, you can use the .html suffix as a work around (many thanks to @Diego Leitao on AUTO-450 for mentioning this):

{{issue.comments.last.body.html}}

Or, if you wanna get fancy with it

{{# issue.comments }}
{{# if(not(internal)) }}
{{#last}}
By: {{author.displayName}}
On: {{created.longDate}}
Comment: {{body.html}}
{{/}}
{{/}}
{{/}}

 

Works for rendering tables in comments properly too!

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.
October 21, 2021

Hi @Ben 

Please consider posting an image of your rule as that my give the community more context to offer ideas.  Thanks!

And, you may want to investigate using the text functions to find those mentions in the comment and then replace (or add) the user display name before sending the email.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer