want to update the incident number field color based on the sla percentage
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2023 02:50 AM
implement the color code (green / yellow / red) in the ticket number field itself at top the page based on SLA percentage
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2023 03:19 AM - edited ‎01-02-2023 03:21 AM
Hi @Shrinidhi Amin
1] Create one onLoad client script on task_sla table. (You can take table accordingly).
2] Use below Script to set color of ticket number field.
function onLoad() {
//Type appropriate comment here, and begin script below
var percentage = g_form.getValue('business_percentage'); // use your field which store SLA percentage
//alert(percentage);
if (percentage >= 0 && percentage <= 25) {
g_form.getDisplayBox('task').style.backgroundColor = 'green'; // take 'ticket number' field insted of 'task'
} else if (percentage >= 26 && percentage <= 50) {
g_form.getDisplayBox('task').style.backgroundColor = 'yellow';
} else if (percentage >= 51 && percentage <= 100) {
g_form.getDisplayBox('task').style.backgroundColor = 'red';
}
}
Please mark as correct answer if this solves your issue.
Thank you
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2023 11:50 PM
can you share exactly where is this required? share screenshot
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader