Script in Workflow Notification

stevenm
Kilo Guru

My users would like an email notification come out of a workflow.   That's all fine and dandy.   However, they would like the body of the email to be based on some of the values entered on the service request.   For instance if a field says approver they would like the email text to reflect approver otherwise have it reflect non-approver.   Will mail_script work within a Workflow Notification?   I'm not getting any output from the if statement below.

Capture.JPG

1 ACCEPTED SOLUTION

stevenm
Kilo Guru

This is really old and I don't recall why my question.  Thanks for replying.  I guess I better mark it closed.

View solution in original post

11 REPLIES 11

Derek17
Tera Contributor
Mekonnen, 
 
This question is not so much related to this topic. However, to get this done you would need to query the variables related to the specific requested item.
 
Please see below example.
 
template.print("Summary of Requested items:\n");
var item = new GlideRecord("sc_req_item");
item.addQuery("sys_id", current.sysapproval);
item.query();

 while(item.next()) { 
  var varown = new GlideRecord('sc_item_option_mtom');
  varown.addQuery("request_item", current.sysapproval);
  varown.orderBy("sc_item_option.order");
  varown.query();
	
    while (varown.next())
    {
      //Print out variables here
    }

 

Hope this helps!

stevenm
Kilo Guru

This is really old and I don't recall why my question.  Thanks for replying.  I guess I better mark it closed.