Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How can we set incident number in to orange color when SLA breached to 90%

anitha0887
Tera Contributor

Hi @Karan Chhabra6 ,

Hi @Abhijit4 ,

Hi @Ankur Bawiskar 

Step 1: Navigate to sys_ui_style.list and create a new record

value: 

javascript: new ElapsedSLA().getSLAPercent(current) >= 90;

anitha0887_2-1748009840818.png

 

 

Step 2: Create a script include named 'ElapsedSLA', please use this script

var ElapsedSLA = Class.create();
ElapsedSLA.prototype = {
    initialize: function() {},

    getSLAPercent: function(incRef) {
        var slaPercent = '';
		var sysID = incRef.sys_id;
        var slaGR = new GlideRecord('task_sla');
        slaGR.addQuery('task', sysID);
        slaGR.query();
        if (slaGR.next()) {
            slaPercent = slaGR.business_percentage;
        }

        return slaPercent;
    },

    type: 'ElapsedSLA'
};

 

I have tried as you mention be,but incident number background color is  not displaying, its just displaying dot color as shown below screenshot, i want to display incident number exactly same like you display.

anitha0887_0-1748009708395.png

 

anitha0887_1-1748009768306.png

 

 

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi,

Can you click on the setting icon of the list ane ensure to set 'Modern cell coloring' to True

JaspalSingh_0-1748010672607.png

 

View solution in original post

2 REPLIES 2

Jaspal Singh
Mega Patron
Mega Patron

Hi,

Can you click on the setting icon of the list ane ensure to set 'Modern cell coloring' to True

JaspalSingh_0-1748010672607.png

 

Thank you so much for HELP