How to tag a user in a comment using pull request API in Bitbucket Cloud?
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
It is possible to tag a user in a commit using the API endpoint REST API - Create a comment on a pull request with the Account ID or Bitbucket UUID.
Solution
- You can use Workspace Membership API to get the details of the UUID/Account ID.
- Example:
curl -v -u username:app_password -X POST 'https://api.bitbucket.org/2.0/repositories/WORKSPACEID/REPO/pullrequests/PULLREQUESTID/comments' --header 'Content-Type: application/json' --data '{"content": {"raw": "@{UUID/ACCOUNTID} Some comment"}}'
Replace with the username, app password, workspace ID, repository name, pull request number and UUID/Account ID (Don't remove the {} and enter the UUID/AccountID within the brackets)
Last modified on Apr 5, 2024
Powered by Confluence and Scroll Viewport.