How to add watchers uisng script-runner cloud? Edited

Hi, I am trying to update watcher field using Script-runner but can't seem to find the right way to do it.

def issue = "DEMO-1"

def result = put('/rest/api/2/issue/' + issue)
.header('Content-Type', 'application/json')
"watchers" : [
if (result.status == 204) {
return 'Success'
} else {
return "${result.status}: ${result.body}"


Serializing object into 'interface java.util.Map'
GET /rest/api/2/issue/DEMO-1 asObject Request Duration: 698ms
[testuser1, testuser2]
PUT request to /rest/api/2/issue/DEMO-1 returned an error code: status: 400 - Bad Request
body: {"errorMessages":[],"errors":{"watchers":"Field 'watchers' cannot be set. It is not on the appropriate screen, or unknown."}}
PUT /rest/api/2/issue/DEMO-1 asString Request Duration: 237ms

1 answer

0 votes

Watchers is not a field, it's a system generated user list.


Well, I got the POST request working fine. Since Atlassian Cloud API does not support UPDATE request watchers yet it cannot be implemented.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 11, 2018 in Marketplace Apps

You + one app + a desert island...

Hi all! My name is Miles and I work on the Marketplace team. We’re looking for better ways to recommend and suggest apps that are truly crowd favorites, so of course we wanted to poll the Community. ...

3,677 views 6 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you