How to mention a user on comment with python jira

Eduardo Rodrigues
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!
November 18, 2023

I used Jira 3.5.2 to connect on Jira cloud with base_auth

How can I add a comment mentioning the user "@username" with "jira.add_comment"?

1 answer

1 vote
Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 19, 2023

Hi @Eduardo Rodrigues

welcome to the Atlassian Community.

Jira converts every @mention from the editor into a markup like this

[~accountid:557058:696ffa9f-e51a-4e96-b501-29a216087196]

So, if you want to mention the same user all the time, you can get their accountid and replace everything after [~accountid: with your account id.
If you need help how to get the accountid, you can

  1. go to an issue where the desired user is assignee or reporter (or in some other field)
  2. open https://YOUR_INSTANCE.atlassian.net/rest/api/2/issue/YOUR_ISSUE_KEY and replace the instance identifier and your issue key.
  3. In the JSON response, search for the assignee or reporter and copy their account id.

Hope this helps,
Matthias.

Suggest an answer

Log in or Sign up to answer