I have followed the example given in this thread:
which points to this example:
I created a ScriptRunner script and added it as a post-function on the Create transition, and I get error 404 below.
When I run the watchers REST API from a browser (after the ticket was created), it succeeds.
I suspect that the problem is that the issue is not yet in the database and hence the 404.
Can someone suggest another way to add watchers in the Create transition?
Thanks
2021-08-08 10:33:37.625 INFO - POST /rest/api/2/issue/IMR-262/watchers asString Request Duration: 398ms 2021-08-08 10:33:37.626 WARN - POST request to /rest/api/2/issue/IMR-262/watchers returned an error code: status: 404 - Not Found body: {"errorMessages":[],"errors":{}}
Code:
def issueKey = issue.key
["john.doe@example.com", "j.l.picard@enterprise.gov"].each { accountId ->
def result = post('/rest/api/2/issue/' + issueKey + '/watchers')
.header('Content-Type', 'application/json')
.body("\"${accountId}\"")
.asString()
}
Hi @Amir Katz (Outseer) ,
Instead of using script runner you could:
Hope all the above helps :)
Alex
Thanks a lot!
We do have both ScriptRunner and JMWE, but the automation is no-code, which is certainly tempting.
The 3rd option - this is a migration from server to cloud, so I don't want to burden my users with additional fields.
Update: Just implemented it with automation - easy-peasy!
Will not check JWME option at this time...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.