Forums

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

Need REST API for ComponentWatchers

Tim Jedlicka
Contributor
June 9, 2022

I can manually edit the "Component Watchers" but would like to do this via the API. 

Documentation for the REST API does not appear to have an entry for componentWatchers.

https://docs.atlassian.com/software/jira/docs/api/REST/latest/ 

1 answer

0 votes
Tim Jedlicka
Contributor
June 9, 2022

https://community.atlassian.com/t5/Jira-questions/scriptrunner-post-function-to-add-watchers-based-on-component/qaq-p/208822 had at least a partial answer:

It looks like there is no public Java API, but there is public REST API. I can see, there are two endpoints which accept "project key" as a parameter

/rest/componentwatchers/1.0/groups/{projectkey}

/rest/componentwatchers/1.0/users/{projectkey}
Response of both endpoints contains this "section" of data
 $ curl --user 'user:passwd' --noproxy "*" "https://jira.example.com/rest/componentwatchers/1.0/groups/VLAB"
{
"projectKey": "VLAB",
"projectName": "VLAB",
"component": "00-RH_OpenShift",
"watchers": [
{
"watcherDatabaseId": "I_VLAB_OPENSHIFT",
"name": "I_VLAB_OPENSHIFT",
"type": "group"
}
Tim Jedlicka
Contributor
June 12, 2022

Still need an API to update (PUT) a componentwatcher record. The above is only for a retrieve (GET).

Suggest an answer

Log in or Sign up to answer