- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Need to determine a method to add a measurement of time all SCTASKs and enhancement request that starts and ends when State is set to Pending Vendor, then moved out of Pending Vendor state.
We may need to add a hidden SLA to measure this, or determine another way.
Is there any best practices to implement this functionality?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
you can use Metrics to capture the time spent in "Pending Vendor" state
you can refer to many OOTB metrics
OR
Another way is to use SLA
Table - sc_task
Start Condition: State [IS] Pending Vendor
Stop Condition: State [IS NOT ONE OF] Pending Vendor
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
First, creating a new field is a customization, so my recommendation is to avoid that. Instead, check if you already have something like a Vendor Pending state available. or create that. You can then set your SLA based on that condition, and from the SLA you can easily track all timing without any complex logic or customization.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
you can use after update BR on task_sla table and update it
Condition:
current.task.sys_class_name == 'sc_task' && current.business_duration.changes()
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var gr = new GlideRecord("sc_task");
gr.addQuery("sys_id", current.task);
gr.query();
if (gr.next()) {
gr.u_field.setDateNumericValue(current.business_duration.dateNumericValue());
gr.update();
}
})(current, previous);
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi Ankur,
Yes its working to update the pending vendor time field in SCTask. Thanks for the support. However we have some additional requirement that as we are configuring SLA for pending vendor state so the duration type should not be "User specific Duration" its should be based on task's due date and if we are go with "Breach on Due Date" duration type(OOTB) 1.we are unable to give pause condition but it is required.
2.If we reset the due date in sctask ,the task sla's breach time is not updating based on DUE date
Kindly suggest me the steps to implement this requirement.
Regards,
Sounder Rajan K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
As a workaround, try applying the SLA manually to one task and check whether the SLA updates according to the new date.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
