Unable to get DOT beside Incident Number field depend on the SLA Calculation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 05:52 AM - edited 07-25-2023 06:00 AM
Hi all,
I have a requirement on Incident list view, When ever the Resolution SLA got breached the red color DOT needs to appear beside the number field from list view. I have tried below steps but not working as expected.
1 Script include.
2. Configured in Number field with style module.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 06:18 AM
Hi there,
your code is not checking if the SLA is breached or not.
Try the following -
function DotColorerSLA() {
var gr = new GlideRecord('task_sla');
gr.addQuery('task', current.sys_id);
gr.addEncodedQuery('target=resolution');
gr.query();
if (gr.next()) {
var percentage = gr.business_percentage;
if (percentage < 100) {
gs.addInfoMessage("The SLA is breached!"); // You can display a message or add additional logic here.
return 'red'; // Return 'red' to apply the red color dot.
} else {
return ''; // Return an empty string if the SLA is not breached.
}
}
}
Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!
Regards,
Tushar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 07:24 AM - edited 07-25-2023 07:49 AM
Hi Tushar,
Thank you for your quick response,
I have updated code in script include with your code, but the number field is not showing red dot after breach of SLA.it should visible same as below priority has.