ScriptRunner: Rest API issue notify for service request participants

Alexey Paveliev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2022

the Service management has a new concept of 'Request participants'

I need to notify them along with reporter and assignee from my script listener

Is there an easy or proven working way to do that? I'd appreciate not spending few hours figuring this out ;)

here is the call that works for other folks looks like:

def resp = post("/rest/api/2/issue/${issue.id}/notify")
.header("Content-Type", "application/json")
.body([
subject: theSubject,
textBody: textMessage,
htmlBody: htmlMessage,
to: [
reporter: true, // bug - 500 error when no reporter
assignee: true, // bug - 500 error when no assignee
// watchers: true,
// voters: true,
// users: [[
// name: 'admin'
// ]],
// groups: [[
// name: 'group name here'
// ]]
]
])
.asString()
assert resp.status == 204

 It is taken from example snippet in ScriptRunner docs. I'm sure I can extract users from the field and add them individually. Anybody done that?

the field is preinstalled locked custom field of it own kind

in my case customFieldId=10027

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events