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 08:29 PM
You're best off using approvals as they are designed for this, rather than trying to change the way the request item works.
To get the request item variables (which I'm guessing that is what you want) from the request item, create another mail script:
Name: Whatever you like, eg: add RITM variables
Script:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(current.sysapproval.sys_id);
set.load();
var vs = set.getFlatQuestions();
for (var i = 0; i < vs.size(); i++) {
if (vs.get(i).getDisplayValue() != '' && +vs.get(i).getLabel() != '') {
template.space("\n");
template.print("\n" + "<br>" + vs.get(i).getLabel() + ": " + vs.get(i).getDisplayValue() + "\n" + "</br>");
}
}
})(current, template, email, email_action, event);
Then in the message HTML just call the mail script - ${mail_script:add RITM variables}
This will loop through and show all your variables and their values. An example of what we have is:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 08:53 PM
Thank you @Bidduam
I'm totally agreed with using approval table. We stuck and did not know what else to do. I have tried your suggestion code and it displays all variables from catalog item.
Here are all the variables from the Catalog Item the we are currently have.
Who is this request for?: Adela Cervantsz
Select an option:: N/A
Email Subject - Notification of Outlook is not available
Description: This is a text
Select Start Date / Time:: 09-26-2023 07:08 PM PDT
Select End Date / Time:: 09-28-2023 07:08 PM PDT
Action: Not
Impact: All users
Send Notification as: : High Priority
Is it possible to modify the script to capture where we get to select with variables needs to be in notification? For example, we only want the blow 4 variables.
Email Subject - Notification of Outlook is not available
Description: This is a text
Select Start Date / Time:: 09-26-2023 07:08 PM PDT
Select End Date / Time:: 09-28-2023 07:08 PM PDT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 09:05 PM
Hi @Bidduam ,
Could you please provide us one example email script to capture one variable for example: email_subject, then we will follow your sample and do one email script for each variable we want to capture. Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 10:35 PM
Sorry that is about where I end. The best way would generally to leave it to display all variables as is so it can be used on any request item no matter what variables are there.
Once you get prescriptive as to which variables to show then it will automatically limit the notifications use.
Having said all that I also don't really know how to set the specific variables to show in the notification like you're asking for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 07:16 AM
Hi @Bidduam ,
Thank you so much for your help. We really appreciate your efforts