Catalog Request Approval emails: Help with notification

velvet
Mega Guru

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

find_real_file.png

When I preview a REQ

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

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.

View solution in original post

32 REPLIES 32

Great. So the one you posted will work for Request.



Use this instead for both



<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.

Are you online Sanjiv?


What do you see in RITM approval email now?



Please mark this response as correct or helpful if it assisted you with your question.

find_real_file.png


Can you send a screenshot of your notification and the notification template attached to it?



Please mark this response as correct or helpful if it assisted you with your question.