Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to send email to multiple users using scriptunner for Jira Cloud

Shilpa Matta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 24, 2022

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

}

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events