- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2023 11:44 PM
Hi. I need to print "Business time left" in SLA. It is a "Duration" type field. I have tried GlideDateTime API and all other general mediums, however, no luck. Can someone please advise.
var task_sla_gr = new GlideRecord("task_sla");
task_sla_gr.addQuery("task", current.number);
task_sla_gr.query;
if(task_sla_gr.next){
var tim = task_sla_gr.getValue("business_time_left")); // getting undefined/ null
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 12:20 AM
task_sla_gr.next()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 12:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 12:33 AM
Hi @EKTA2 ,
I think you need to change the code a little bit. try the below code and see if it works.
var task_sla_gr = new GlideRecord("task_sla");
task_sla_gr.addQuery("task.number", current.number);
task_sla_gr.query();
while(task_sla_gr.next()){ //I had used while because there will be more than one SLA. Use addQuery if you need to add more filter
var tim = task_sla_gr.business_time_left.getDisplayValue();
}
Mark Helpful and correct if it helps in Solving your query.
Regards,
Johns