Is it possible to send single email with bulk issues? Edited

Hi Tyler here


So i am just wondering if it is possible to send a single email using XMLMarkupBuilder and the Rest API Notifiy request together to send a single email with bulk issues.

I am currently using Jira Cloud with ScriptRunner.

I am developing my script using the escalation service, so it prompts every day at 6pm to send an email.

My current code sends a single email per issue:


import groovy.xml.MarkupBuilder

if (issue.fields?.timetracking?.originalEstimate == null) {
def writer = new StringWriter()
def markupBuilder = new MarkupBuilder(writer)
markupBuilder.div {
p {
a(href: "${issue.key}", issue.key)
span("This issue does not have an Estimate")

def htmlMessage = writer.toString()
def textMessage = new XmlSlurper().parseText(htmlMessage).text()

def resp = post("/rest/api/2/issue/${}/notify")
.header("Content-Type", "application/json")
subject: "${} has no Estimate",
textBody: textMessage,
htmlBody: htmlMessage,
to: [
reporter: issue.fields.reporter != null, // bug - 500 error when no reporter
assignee: issue.fields.assignee != null, // bug - 500 error when no assignee
users: [[
name: 'Tyler Brown-Jones'
groups: [[
// name: 'site-admins',
assert resp.status == 204


I need this to send a single email with all the issues it captures with an estimate missing (This is due to having over 7000+ issues to go through). 

I hope you can help and many thanks


0 answers

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

352 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you