Skip to content

Instantly share code, notes, and snippets.

@cmcdevitt
Created January 24, 2014 00:24
Show Gist options
  • Save cmcdevitt/8589692 to your computer and use it in GitHub Desktop.
Save cmcdevitt/8589692 to your computer and use it in GitHub Desktop.
ServiceNow Jelly Check for Incident
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_gr" object="true">
var gr = new GlideRecord("incident");
gr.addQuery("state","=", "2");
gr.addQuery("category","=", "Sales and Service");
gr.query();
gr;
</g:evaluate>
<j:if test="${!jvar_gr.hasNext()}">
<span>No Reported Outage</span>
</j:if>
<j:if test="${jvar_gr.next()}">
<span>M: ${jvar_gr.getValue('number')} ${jvar_gr.getValue('short_description')}</span>
</j:if>
</j:jelly>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment