- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2018 11:29 AM
Currently we have the approval for the Request automatically being approved. But we need an approval for the RITM, catalog item approved by the approving manager. For the RITM, it was setup to use the approval request email, with the change.itil.approve.role, which is incorrect, but with it firing off when approval.inserted we are getting the email but with the incorrect info or not all the info... So I want to user the Catalog Request Approval email, with the request.itil.approve.role that fires off when an approval.inserted. The email is received when using that email template but not all the info is showing. But what I have noticed is that when I preview this notification and put in a RITM is does not show the information, but when I put in a REQ to preview it shows the information that I need. So how do I get the REQ info in the email when the RITM is sent for an approval. Or what am I doing wrong...
When I preview a RITM
When I preview a REQ
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2018 01:32 PM
One correction made. try this
<div>${mail_script:branded_email_header}</div>
<div>Short Description: ${sysapproval.short_description}</div>
<div>Priority: ${sysapproval.priority}</div>
<div>Requested For: ${sysapproval.requested_for}</div>
<div>Requested By: ${sysapproval.opened_by}</div>
<div>Total Price: ${sysapproval.price}</div>
<hr/>
<mail_script>
template.print("Summary of Requested items:\n");
var item = new GlideRecord("sc_req_item");
if (current.sysapproval.sys_class_name == 'sc_request')
item.addQuery("request", current.sysapproval);
else
item.addQuery("sys_id", current.sysapproval);
item.query();
while(item.next()) {
template.print(item.number + ": " + item.quantity + " X " + item.cat_item.getDisplayValue() + " at " +
item.price.getDisplayValue() + " each \n");
template.print(" Options:\n");
var keys = new Array();
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(item.sys_id);
set.load();
var vs = set.getFlatQuestions();
for (var i=0; i < vs.size(); i++) {
if(vs.get(i).getLabel() != '') {
template.space(4);
template.print(' ' + vs.get(i).getLabel() + " = " + vs.get(i).getDisplayValue() + "\n");
}
}
}
</mail_script>
Comments:
${sysapproval.description}
<hr/>
${mailto:mailto.approval}
<hr/>
${mailto:mailto.rejection}
<hr/>
Click here to view Approval Request: ${URI}
Click here to view ${sysapproval.sys_class_name}: ${sysapproval.URI}
<div>${mail_script:branded_email_footer}</div>
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2018 01:06 PM
I didn't change anything only changed the script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2018 01:32 PM
One correction made. try this
<div>${mail_script:branded_email_header}</div>
<div>Short Description: ${sysapproval.short_description}</div>
<div>Priority: ${sysapproval.priority}</div>
<div>Requested For: ${sysapproval.requested_for}</div>
<div>Requested By: ${sysapproval.opened_by}</div>
<div>Total Price: ${sysapproval.price}</div>
<hr/>
<mail_script>
template.print("Summary of Requested items:\n");
var item = new GlideRecord("sc_req_item");
if (current.sysapproval.sys_class_name == 'sc_request')
item.addQuery("request", current.sysapproval);
else
item.addQuery("sys_id", current.sysapproval);
item.query();
while(item.next()) {
template.print(item.number + ": " + item.quantity + " X " + item.cat_item.getDisplayValue() + " at " +
item.price.getDisplayValue() + " each \n");
template.print(" Options:\n");
var keys = new Array();
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(item.sys_id);
set.load();
var vs = set.getFlatQuestions();
for (var i=0; i < vs.size(); i++) {
if(vs.get(i).getLabel() != '') {
template.space(4);
template.print(' ' + vs.get(i).getLabel() + " = " + vs.get(i).getDisplayValue() + "\n");
}
}
}
</mail_script>
Comments:
${sysapproval.description}
<hr/>
${mailto:mailto.approval}
<hr/>
${mailto:mailto.rejection}
<hr/>
Click here to view Approval Request: ${URI}
Click here to view ${sysapproval.sys_class_name}: ${sysapproval.URI}
<div>${mail_script:branded_email_footer}</div>
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 07:15 AM
Ok I will try now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 08:42 AM
No email was sent. Also I need this to be sent with the RITM information when a RITM approval is requested
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 08:44 AM
On the preview all information is not there when I preview a RITM but it is when I preview a REQ the REQ info is there...