The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

When adding a watcher through the api, how am I supposed to pass in the accountid?

Dylan Shukster
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!
January 15, 2025

addWatcher = invokeurl

[

url :"https://atlassian.net/rest/api/3/issue/issueId/watchers"

type :POST

parameters:"accountId"

headers:headers

];

I pass in the variables and include my org url, when I run the code with an account id nothing happens, how is that accountId supposed to be passed in? Can someone share the exact code of the body.


1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Shawn Doyle - ReleaseTEAM
Community Champion
January 15, 2025

Hi @Dylan Shukster 

 

You pass the user by account ID as you are trying to do. 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-watchers/#api-rest-api-3-issue-issueidorkey-watchers-post

The examples aren't great but they are expecting the account ID as the string in "<string>"

Dylan Shukster
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!
January 15, 2025

Request bodyapplication/json

The account ID of the user. Note that username cannot be used due to privacy changes.

string

This is what it says to pass in, does not specify the variable so I want to confirm if I am passing it in correctly in my code. Like this parameters:"accountId" or if I need to pass it in as an object like  "accountId": { "id": "5b109f2e9729b51b54dc274d" }?

Shawn Doyle - ReleaseTEAM
Community Champion
January 16, 2025

just the string

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events