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%+)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2017 02:33 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2017 02:55 AM
You go to the table you are showing: In the Value field:
enter the following code; javascript: GlobalFunctions().getSLAStage() >75 && <100
and in Style: Enter: background-color:orange.
Like this you can color code for <=50% to be green and >=100 to be red.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2017 02:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2017 03:24 AM
Thanks Aakash,
i write three styles based on conditions..i am trying to call script include from style. how can get SLA 50% reached or else..
how can write code .
below code is breaches scenario but i need sla <50% and sla>75 and sla>50 && sla<75
var gr = new GlideRecord('task_sla');
gr.addQuery('task', number);
gr.addQuery('stage', 'breached');
gr.query();
return gr.hasNext();
thanks
sanjay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2017 03:31 AM
Did you check this
You can achieve what you are trying to do following these steps:
First create a script include named new GlobalFunctions,
API Name: global.GlobalFunctions
GlobalFunctio
and script as below;
var GlobalFunctions = Class.create(0;
GlobalFunctions.prototype = Object.extendsObject(AbsstractAjaxProcessor,{
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;
}
});
Make sure you check 'client callable and Active to be true.
Then you go to the table you are showing: In the Value field:
enter the following code; javascript: GlobalFunctions().getSLAStage() >75 && <100
and in Style: Enter: background-color:orange.
Like this you can color code for <=50% to be green and >=100 to be red.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2017 03:35 AM