- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2020 11:22 PM
Hi,
Is it possible to create a custom approval notification based on the service catalog item?
Ex:
The workflow for the catalog item XXXX Form includes an approval. When the approval is generated, I want to include the fields in the catalog item in the approval notification that is sent, including the Approve and Reject buttons.
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2020 02:53 AM
Hi,
For RITM fields you can use this
Example below
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
template.print('Catalog Item: ' + current.sysapproval.cat_item.name);
})(current, template, email, email_action, event);
For printing RITM variables use this
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
template.print('RITM Variables: <br/>');
var variables = current.sysapproval.variables.getElements();
for (var i=0;i<variables.length;i++) {
var question = variables[i].getQuestion();
var label = question.getLabel();
var value = question.getDisplayValue();
if(label != ''){
template.space(4);
template.print(' ' + label + " = " + value + "<br/>");
}
}
})(current, template, email, email_action, event);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2020 02:53 AM
Hi,
For RITM fields you can use this
Example below
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
template.print('Catalog Item: ' + current.sysapproval.cat_item.name);
})(current, template, email, email_action, event);
For printing RITM variables use this
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
template.print('RITM Variables: <br/>');
var variables = current.sysapproval.variables.getElements();
for (var i=0;i<variables.length;i++) {
var question = variables[i].getQuestion();
var label = question.getLabel();
var value = question.getDisplayValue();
if(label != ''){
template.space(4);
template.print(' ' + label + " = " + value + "<br/>");
}
}
})(current, template, email, email_action, event);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2020 06:31 AM
Hope you are doing good.
Let me know if I have answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader