Forums

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

How can we allow user emails to be shown in the new view for issue comments?

Maxx Lehmann
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!
January 26, 2021

We have a use case where comments are created on Jira issues through the api, in the format `[~user.email@address.com]`. In the old Jira view the email would display normally, in the new view the tag renders as a "User" pill, that links to an unknown user.

 

How can we allow the user's email to be rendered in the comment?

1 answer

0 votes
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 27, 2021

Hello @Maxx Lehmann,

Welcome to Atlassian Community!

Testing on my local site, adding a comment via API using the endpoint below, it added a comment and it shows the user email address. I added it using the same format you mentioned here.

Screen Shot 2021-01-27 at 15.13.39.png

curl --request POST \
  --url
'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment' \
  --user 'email@example.com:<api_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "body": {
    "type": "doc",
    "version": 1,
    "content": [
      {
        "type": "paragraph",
        "content": [
          {
            "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.`[~user.email@address.com]`",
            "type": "text"
          }
        ]
      }
    ]
  }
}'

In case you want to mention a user, please, check the thread below that has more details about it:

If that's not what you needed, please, let us know more details about the issue, and feel free to share screenshots (just make sure to hide private information).

Regards,
Angélica

Maxx Lehmann
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!
January 27, 2021

Hi Angelica,

 

We are currently using the V2 API.

 

In the new view, this is what is shown: 

Screen Shot 2021-01-27 at 2.13.29 PM.png

And this is what we had in the old view:

Screen Shot 2021-01-27 at 2.18.47 PM.png

 

I think I understand more clearly now, that the `User` pill is displaying because the tagged user is not found, as it uses whatever is the [~xxx] as an `accountId`.

 

Is there any way to show the email like in the old view?

Alternatively, is there any chance a `commentOnBehalfOf` would be implemented any time soon? That would easily fix this use case.

Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 29, 2021

Thank you for the details, Maxx.

The old view uses Wiki Markup and the new one Markdown, that's why the syntax you are using is not working as expected, so any email that you add using the format `[~user.email@address.com]` will end up showing as "@user".

In this case, since currently there is no endpoint to comment on behalf of an user, you can use the API v3 to mention the author. It will show their full name when mentioning and if you want to show their email address, then you need to add it as a text and it will show on the comment as a normal text (not a link).


Screen Shot 2021-01-29 at 13.51.46.png

curl -v --request POST \
--url 'https://domain.atlassian.net/rest/api/3/issue/ISSUEKEY-123/comment' \
--user 'user@domain.com:TOKEN' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"body": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Author: user@domain.com\n\n",
"type": "text"
},
{
"type": "mention",
"attrs": {
"id": "1a23b45c6789101d2e345678",
"text": "user@domain.com",
"userType": "APP"
}
}
]
}
]
}
}'

Suggest an answer

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

Atlassian Community Events