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_TICKET_URL="https://test.atlassian.net/rest/api/latest/issue/DEV-12345/comment"
# 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
JIRA_USERNAME="test@test.com"
JIRA_API_TOKEN="1234567890"
# Send comment to Jira
curl -X POST \
  -H "Content-Type: application/json" \
  -u "$JIRA_USERNAME:$JIRA_API_TOKEN" \
  --data "$COMMENT_DATA" \
  "$JIRA_TICKET_URL"