Created
January 28, 2014 20:54
-
-
Save cmcdevitt/8676214 to your computer and use it in GitHub Desktop.
ServiceNow email script list catalog item and varables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mail_script> | |
template.print("<p></p>Requested items:\n"); | |
var gr = new GlideRecord("sc_req_item"); | |
gr.addQuery("request", current.sysapproval); | |
gr.query(); | |
while(gr.next()) { | |
template.print(gr.number + ": " + gr.cat_item.getDisplayValue() + ", Stage: " + gr.stage.getDisplayValue() + "\n"); | |
for (key in gr.variables) { | |
var v = gr.variables[key]; | |
if(v.getGlideObject().getQuestion().getLabel() != '') { | |
template.space(4); | |
template.print(' ' + v.getGlideObject().getQuestion().getLabel() + " = " + v.getDisplayValue() + "\n"); | |
} | |
} | |
} | |
</mail_script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment