How to add approve and reject links on requested item notification?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 07:45 PM
Hello,
I could not figure it out a way to add the approve and reject links on the requested item email notification.
Could some please help? Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 07:53 PM - edited 09-25-2023 07:55 PM
Generally you would just have a mail script for an approval or a rejection that would be a link to create an email reply for either response. Or if you wanted users to approve or reject via the portal in the approval ticket you would have a link via a mail script to the approval record.
What we have is a button image for approve or reject saved in images within ServiceNow then we have the following mail scripts:
EG:
Give the mail script a name: approve.email.button
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var img = "/Approve.png";
var response = "approve";
var emailbod = "I approve this request. \r\n";
template.print(renderMailtoButton(img, response, emailbod));
})(current, template, email, email_action, event);
Then for the reject do the same:
Give the mail script a name: reject.email.button
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var img = "/Reject.png";
var response = "reject";
var emailbod = "I reject this request.";
template.print(renderMailtoButton(img, response, emailbod));
})(current, template, email, email_action, event);
Then in your notification add the mail script links:
Click the response you wish to make
${mail_script:approve.email.button} ${mail_script:reject.email.button}
Looks like this:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 08:03 PM
Thank you so much for helping @Bidduam
Your buttons are very nice done. How do I call those email scripts from sc_req_tiem?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 08:11 PM
You would need to have a notification setup on the approval table such as: (this is so when an approval request is added to a request item)
Name: Whatever you like
Table: Approval [sysapproval_approver]
Category: Service Catalog
When to Send:
Send When: Record inserted or updated
updated: ticked
inserted: ticked
Conditions:
State changes to Requested
Approval for.task type is Requested Item
Who will receive:
Users/Groups in fields: Approver
What it will contain:
Email template: Whichever you like
Subject: Something like - Request ${sysapproval} needs your approval
Message HTML:
Add what you want followed by the email script codes shown before.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 08:18 PM
Thank you @Bidduam
We need approve and reject links on the sc_req_item table. The reasons why we need those links show up there is because we don't know how to capture the variables from catalog item on to approval table.
So we decided to add approve and reject on sc_req_item table. Can this be done? If not, do you know how to we can get the variables displays on the approval table notification?