- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2021 10:36 AM
Hi,
I have a requirement to display the Business elapsed percentage field on the incident list view.
the field is related list on the incident table and is from the task sla table.
so i have this displayed as a related list within the incident form, but I need this displaying in the list view on incidents like below. so it should bee at the far right displaying the same bar like percentage.
How can I achieve this please?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2021 07:19 AM
Hi,
another easy method
1) create reference field on incident table
a) Name - u_task_sla
b) Type - reference
c) Referred to - task_sla
2) Now on the incident list you can dot walk the new field and add the business percentage field via dot walking
3) Remember to populate this new field after insert of task_sla
Condition: current.task.sys_class_name == 'incident'
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var inc = new GlideRecord('incident');
inc.get(current.task);
inc.u_task_sla = current.sys_id;
inc.update();
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2021 07:19 AM
Hi,
another easy method
1) create reference field on incident table
a) Name - u_task_sla
b) Type - reference
c) Referred to - task_sla
2) Now on the incident list you can dot walk the new field and add the business percentage field via dot walking
3) Remember to populate this new field after insert of task_sla
Condition: current.task.sys_class_name == 'incident'
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var inc = new GlideRecord('incident');
inc.get(current.task);
inc.u_task_sla = current.sys_id;
inc.update();
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2021 07:39 AM
Hi Ankur,
I created a read-only field referencing task_sla table before, and applied the BR to this as below
it now works but it isnt displaying the business percentage, it is displaying sla definition, how do i change this to display business percentage please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2021 07:51 AM
update:
followed your previous instructions and dot walked to the new field and now business percentage is showing! thank you!
However it is still showing the sla definition in the actual incident form, in the new resolution sla field as below
Also, how can I populate the business percentage for incidents that are already existing? as they are currently empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2021 09:08 PM
Glad to know that my approach helped.
So the field on list is showing the Business Percentage from Task SLA.
I didn't get the other part
However it is still showing the sla definition in the actual incident form, in the new resolution sla field as below
-> on the form also you will have to configure the form layout and add the dot walked field from that newly created field
Also, how can I populate the business percentage for incidents that are already existing? as they are currently empty
For that you need to write fix script
updateRecords();
function updateRecords(){
var rec = new GlideRecord('task_sla');
rec.addQuery('task.sys_class_name', 'incident');
rec.query();
while(rec.next()){
var inc = rec.task.getRefRecord();
inc.u_new_field = rec.sys_id;
inc.setWorkflow(false);
inc.update();
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2021 02:19 AM
Hi
I have added the dot walked field for the workspace view too as I need it showing in Agent Workspace, however, over there it only shows as number, not as percentage and it also doesnt show the percentage bar, see below.
1. How can I add percentage bar here? if not, how can I show the % after the numbers?
2. I need the field to change colour once certain percents are reached (red, amber, green) for example.
I tried highlighted values for workspace, but that only works for the field chosen and since the business elapsed percentage field is dot-walked I cant chose it from the list and hence cannot apply colours to it.
Is there another way i can do this?