pycontribs / jira

Python Jira library. Development chat available on https://matrix.to/#/#pycontribs:matrix.org
https://jira.readthedocs.io
BSD 2-Clause "Simplified" License
1.95k stars 864 forks source link

What is the correct way to mention a user in a comment? #1737

Closed vihan-agarwal closed 1 year ago

vihan-agarwal commented 1 year ago

I checked the documentation but it doesn't mention how to handle this case. The UI in JIRA Cloud autocompletes so I can't determine if its using the email or name of account or something else. Here is what I have, but I have seen from multiple threads that you need to use ~ instead of @?

user = first.last@org.com
comment = f"@{user} some text \n some text \n more text"

jira.add_comment('TKT-123', comment)

edit: tried all the following and they all show up as @User in the ticket.

Adding how to do this in the docs would be huge!

vihan-agarwal commented 1 year ago

I was able to achieve this using comment = f"[~accountId:{user.accountId}] some text \n ...". Would be nice to have in the documentation somewhere.