I believe everyone is familiar with jira. In daily life, we may need to use the API to interact. We may need to submit comments and @ someone, but the new API cannot directly @ the user name, which has been changed to accountid.

Get user accountid

curl --request GET \
  --url 'https://test.atlassian.net/rest/api/latest/user/search?query=test@test.com' \
  --user 'test@test.com:password' \
  --header 'Accept: application/json'

Send comment to jira

# Jira ticket URL
# Jira comment payload
COMMENT_DATA="{\"body\": \"[~accountid:556677:fb55b345-bb88-4567-a669-dba6cebbdf58], plese review this ticket, pushed new git branch.\nupdate info: ${Commit_Info}\"}"
# Jira username and API token
# Send comment to Jira
curl -X POST \
  -H "Content-Type: application/json" \
  --data "$COMMENT_DATA" \