Hi,
I've got a problem trying to send a notification to the reporter of a issue or a defined user using Adaptavist Scriptrunner Escalation Service and and JIRA Clourd REST API v2 /rest/api/2/issue/${issue.key}/notify.
I created a script two weeks ago and it worked like expected and sends mails. But for some reason since last week (nothing has changed in the script) I receive an error when I run this script. Here is what it looks like:
def resp = post("/rest/api/2/issue/${issue.key}/notify")
.header("Content-Type", "application/json")
.body([
subject: 'Done Issue reminder',
textBody: "This issue was set to status \"Done\" two days ago and will be closed automatically tomorrow!",
htmlBody: "<p>This issue was set to status \"Done\" two days ago and will be closed automatically tomorrow!</p>",
to: [
reporter: true
]
])
.asString()
This is was the log says:
POST request to /rest/api/2/issue/ISSUEKEY/notify returned an error code: status: 400 - Bad Request body: {"errorMessages":["No recipients were defined for notification."],"errors":{}}
I also tried to define the user directly with:
users: [[
name: "myusername",
active: true
]]
but got the same error.
Is someone experiencing the same problems or was there something changed for Scriptrunner?
Greetings