We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

The color of list view of the 'number' field must be changed according to the SLA.(e.g. green for less than 50%, yellow for 50 to 75% and red for 75%+)

snajaykumar1234
Kilo Expert

The color of list view of the 'number' field must be changed according to the SLA.(e.g. green for less than 50%, yellow for 50 to 75% and red for 75%+)

give example for this scenario.

Thanks

Sanjay

14 REPLIES 14

You can use any number of conditions, the only thing you need to keep in mind is that the value should return true in order to   run your style.


snajaykumar1234
Kilo Expert

Hi Aakash,



I am trying but i didnt get any changes in number field. i will share my screen to...please suggest me any changes you want




style.pngsi.png


thanks


sanjay


Please copy this code



Script include :



var GlobalFunctions = Class.create();


GlobalFunctions.prototype = Object.extendsObject(AbstractAjaxProcessor,{


      getSLAStage : function() {


              gs.log("script called");


              var stag = '';


              var gr = new GlideRecord('task_sla');


              gr.addQuery('task', current.sys_id);


              gr.query();


              if(gr.next())


                      {


                      var color;


                      stag = gr.percentage;


              }


              return stag; // it will return current stage


      }


});





snajaykumar1234
Kilo Expert

Hi Aakash,



i am using same code what you have shared. but nothing happen in incident list..


i share my incident list. please check it.


incident.png


thanks


sanjay


Can you please confirm that the SLA is breached in the incidents?