- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 01:18 AM
I have a requirement when SLA breached to 100% then incident should highlighted in Red color.
referred this link but not helpful : - https://www.servicenow.com/community/developer-forum/how-can-we-set-incident-number-in-to-orange-col...
how to achieve this?
Thank you in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 02:38 AM
@shweta14 Thanks - you need to make changes to your script include, since you have multiple SLA's attached and the incident should be highlighted even if one SLA exceeds the threshold.
Update the value in the style record to:
javascript: new ElapsedSLA().getSLAPercent(current) == true;
Update the script include
var EscalateSLA = Class.create();
EscalateSLA.prototype = {
initialize: function() {},
getSLAPercent: function(incRef) {
var flag = false;
var slaPercent = '';
var sysID = incRef.sys_id;
var slaGR = new GlideRecord('task_sla');
slaGR.addQuery('task', sysID);
slaGR.query();
while (slaGR.next()) {
if(slaGR.business_percentage >=90){
flag = true;
return flag;
}
}
return flag;
},
type: 'EscalateSLA'
};
If my answer has helped with your question, please mark it as correct and helpful
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 01:44 AM
Please use
javascript: new EscalateSLA().getSLAPercent(current) >= 90;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 01:48 AM
Hi Jaspal,
tried but not working both conditions are same
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 02:04 AM
Hi @shweta14 ,
Do you have multiple SLA's attached to the incident record for which you're testing this, if yes - could you please share a screenshot of that?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 02:19 AM
Hi Karan,
There is no specific one i'm checking.Based on 100% breach checking the incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 02:25 AM
for example checking for this