Hi,
trying to notify users via POST method: '/rest/api/3/issue/' + issueId + '/notify' in ScriptRunner, this error appears:
{"errorMessages":["Unrecognized field \"delegate\" (Class com.atlassian.jira.issue.fields.rest.json.beans.GroupJsonBean), not marked as ignorable\n at [Source: com.atlassian.plugin.connect.plugin.auth.scope.InputConsumingHttpServletRequest$1@1e68716f; line: 1, column: 213] (through reference chain: com.atlassian.jira.issue.fields.rest.json.beans.NotificationJsonBean[\"to\"]->com.atlassian.jira.issue.fields.rest.json.beans.ToJsonBean[\"groups\"]->com.atlassian.jira.issue.fields.rest.json.beans.GroupJsonBean[\"delegate\"])"]}
Post method used:
def result = post('/rest/api/3/issue/' + "TEST-1" + '/notify')
.header('Content-Type', 'application/json')
.header('Authentication', 'Basic user:password')
.body(
[
htmlBody: "The <strong>latest</strong> test results for this ticket are now available. Blahblahblah",
subject: "Blah",
textBody: "TextBody blahblah",
to: [
voters: false,
watchers: false,
groups: [
{name: 'test-notify'
}
],
assignee: false,
reporter: false,
]
])
.asString().body
The issue is with the "groups", it seems ScriptRunner expects some 'delegate' field, which is not in API documentation. Once groups are removed, code works correctly
How can I send notifications to Groups?
Thank you
It is odd that you get all four when creating a top level issue, I would expect only the fields for that issue to be calculated.
Getting four on the sub-task is expected though. You can think of scripted fields as being calculated when an issue is indexed, and when you create a sub-task, the parent is indexed as well.
You can't change this behaviour, it's always going to run the scripts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.