I have a usecase where I want to send an email to multiple users using scriptrunner in Jira Cloud. How can I achieve this ? Below is the code I am using, but it only sends the email to first user
Note : The 'to' field should have multiple users 'Shilpa Matta' and 'Second User'
def resp = post("/rest/api/2/issue/${issue.id}/notify")
.header("Content-Type", "application/json")
.body([
subject: 'New Email to multiple users',
textBody: textMessage,
htmlBody: htmlMessage,
to: [
users: [[name: 'Shilpa Matta'],[name: 'Second User']]
]
])
.asString()
assert resp.status == 204
}