Upon resolving an Incident, how can you show a Breach Reason field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2014 03:55 PM
I've created a Breach Reason field to help track why we missed hitting SLAs. I would like to only show this field and make it mandatory when the ticket has been breached, but I have not been able to figure out how to do so.
The field has been created in the INCIDENT table so it can show up on the incident form, but the SLA information I want is in the TASK_SLA table.
I appreciate your consideration and any help you might be able to offer in this regard.
Thank you,
Michael Snow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2014 11:29 PM
Hi Michael,
Please let me know, how did you accomplish this requirement.
Thanks & Regards,
Preety Arora.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2014 01:06 AM
you would either need to evaluate whether it's breached a)upon selecting resolved via client script b)evaluate whether it's breached on display in a BR, I went for the Display BR method:
checkforBreached();
function checkforBreached(){
g_scratchpad.hasbreached = false;
var ct = new GlideRecord('task_sla');
ct.addQuery('task', current.sys_id);
ct.addQuery('sla.type','SLA');
ct.addQuery('has_breached',true);
ct.query();
if (ct.next()){
g_scratchpad.hasbreached = true;
}
}
so that passes the hasbreached scratchpad value into the client which means you don't need to evaluate anything client side except the scratchpad value:
client script onchange of incident state to resolved:
if (g_scratchpad.hasbreached == true) {
g_form.setDisplay('u_reason_for_sla_breach',true);
g_form.setMandatory('u_reason_for_sla_breach',true);
}
else {
g_form.setDisplay('u_reason_for_sla_breach',false);
g_form.setMandatory('u_reason_for_sla_breach', false);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2014 12:47 AM
Please check below thread
https://community.servicenow.com/thread/167464
This is also an another way to do this task.
Many Thanks !!
Preety Arora.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2014 07:51 AM
I am sorry, but that was not completed. But it looks like mguy has addressed it below