Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Customizing Jira Service Desk Approval Emails with Approve/Decline Buttons

Asya
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!
April 9, 2026

Dear community,

I’m facing the following issue in Jira Data Center (Service Desk):

I would like approvers to receive an email notification when the issue transitions to the approval status. However, the email should include additional non-default fields (for example, custom fields that are not normally visible in the default approval notification).

At the same time, it is important that the email still contains the built-in Approve and Decline buttons available in the standard Jira approval emails.

Is it possible to create such a customized approval email using native Jira functionality or ScriptRunner, while preserving the Approve and Decline buttons?

3 answers

2 accepted

7 votes
Answer accepted
Nikola Perisic
Community Champion
April 9, 2026

Hello @Asya , this can partially be done when you go to Space Settings -> Notifications -> Customer notifications -> Approval required

Screenshot 2026-04-09 at 15.29.49.png

From the picture you can see that there isn't an option for adding your custom field. Even if you try with options like ${issue.customfield_XXXX} it won't present the value itself.

Asya
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!
April 9, 2026

Thank you Nikola, Do you have any info how I can use ScriptRunner in this case?

Nikola Perisic
Community Champion
April 11, 2026

Have you checked the article: https://community.atlassian.com/forums/Jira-Service-Management-articles/JSM-Approvals-by-Email-with-a-work-around/ba-p/1696674#M699 by @John Funk ? @Marc -Devoteam- also mentioned this article.

For the ScriptRunner, you would use a listener on the even Work item updated. Replace the values from the script to match your custom field ID. To find your custom field ID, you would need to get to Context and values and in your URL you will see the ID.

// Event: Work Item Updated / Issue Updated

def eventIssue = Issues.getByKey(issue.key as String)

// Guard: only run in your JSM project
if (eventIssue.projectObject.key != "SD") {
return
}

// Guard: only run in approval status
if (eventIssue.status.name != "Waiting for approval") {
return
}

// Read your custom field by name
def businessJustification = eventIssue.getCustomFieldValue("Business Justification")?.toString()

if (!businessJustification) {
logger.info("No Business Justification value, skipping notification")
return
}

// Read approvers field
// Replace with your actual approver custom field name if needed
def approvers = eventIssue.getCustomFieldValue("Approvers")

if (!approvers || approvers.isEmpty()) {
logger.info("No approvers found, skipping notification")
return
}

// Optional: avoid duplicate sends
def alreadySent = eventIssue.getCustomFieldValue("Approval Reminder Sent")
if (alreadySent == "Yes") {
logger.info("Reminder already sent, skipping")
return
}

// Build recipient list from accountIds
def accountIds = approvers.collect { it.accountId }.findAll { it }

// Build notification payload for Jira notify API
def payload = [
subject: "Approval needed for ${eventIssue.key}: ${eventIssue.summary}",
textBody: """Approval is required for ${eventIssue.key}

Summary: ${eventIssue.summary}
Business Justification: ${businessJustification}

Open request: ${baseUrl}/browse/${eventIssue.key}
""",
htmlBody: """
<p>Approval is required for <strong>${eventIssue.key}</strong></p>
<p><strong>Summary:</strong> ${eventIssue.summary}</p>
<p><strong>Business Justification:</strong> ${businessJustification}</p>
<p><a href="${baseUrl}/browse/${eventIssue.key}">Open request</a></p>
""",
to: [
users: accountIds.collect { [accountId: it] }
]
]

// Send notification
def resp = post("/rest/api/3/issue/${eventIssue.key}/notify")
.header("Content-Type", "application/json")
.body(payload)
.asString()

if (resp.status >= 200 && resp.status < 300) {
logger.info("Notification sent for ${eventIssue.key}")

// Mark as sent so it does not resend
eventIssue.update {
setCustomFieldValue("Approval Reminder Sent", "Yes")
}
} else {
logger.error("Notify API failed: ${resp.status} ${resp.body}")
}

 Replace 

2 votes
Answer accepted
John Funk
Community Champion
April 9, 2026

Hi Asya,

Prior to JSM Cloud incorporating this as a normal function (not sure if DC has done that not, but check that first), I created this article on how to do it with an automation rule. You can modify as needed to fit your use case/tools. 

https://community.atlassian.com/t5/Jira-Service-Management-articles/JSM-Approvals-by-Email-with-a-work-around/ba-p/1696674#M699

 

3 votes
Marc -Devoteam-
Community Champion
April 9, 2026

HI @Asya 

Yes this is possible.

In the project settings of the JSM projects, go to the section "Customer notifications", choose the Approval required notification and edit the content of the notification,

Asya
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!
April 9, 2026

Thank you Marc

Marc -Devoteam-
Community Champion
April 10, 2026

Hi  

Why would you need scriptrunner?

You can do this on using automation, see this article: https://community.atlassian.com/forums/Jira-Service-Management-articles/JSM-Approvals-by-Email-with-a-work-around/ba-p/1696674#M699 

You might be able to duplicate this in Scriptrunner.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events