- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2016 03:32 AM
Hi we have a requirement like in the ITIL home page we need to display a dot before incident number which is based on SLA duration
No Dot if SLA duration is <80%
Amber (orange) dot when SLA hits 80% duration
if SLA breached or touched 100% then a red dot needs to be shown.
( see the image attached)
Pls describe how can i achieve this.
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2016 09:49 AM
Hi,
I am able to achieve it using below code: and its working fine for me:
In Style : value :: javascript:DotColorerSLA() > 80
Style :: background-color:red;
Script Include :--> DotColorerSLA()
function DotColorerSLA() {
var per = '';
var gr = new GlideRecord('task_sla');
gr.addQuery('task', current.sys_id);
gr.query();
if(gr.next())
{
per = gr.business_percentage;
}
//gs.addInfoMessage("per-->"+per);
//gs.log("per-->"+per);
return per;
}
PS: Hit like, Helpful or Correct depending on the impact of the response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2016 05:54 AM
How are you testing it ? Field styles with javascript: will work only on list layout and not on form layout.
Also the 'new' keyword is missing in the field style call.
Syntax:
javascript: new scriptincludename().functionname();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 06:01 AM
I have been verifying it in list layout only not in the form.
and i have been using "==" only i pasted here wrong by mistake.
and after all this any idea why the indicator is not appearing in the list view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2016 09:49 AM
Hi,
I am able to achieve it using below code: and its working fine for me:
In Style : value :: javascript:DotColorerSLA() > 80
Style :: background-color:red;
Script Include :--> DotColorerSLA()
function DotColorerSLA() {
var per = '';
var gr = new GlideRecord('task_sla');
gr.addQuery('task', current.sys_id);
gr.query();
if(gr.next())
{
per = gr.business_percentage;
}
//gs.addInfoMessage("per-->"+per);
//gs.log("per-->"+per);
return per;
}
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2016 11:04 AM
Your solution was very much helpful dear !!! Thank you !