I want escalate button to be added after 48 hours of case creation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 04:24 AM
Hi All,
I need escalate UI action should be visible to users after 48 hours of case creation.
Can you please suggest what needs to be added in the condition of UI action.
I will have to send an email once the case is escalated.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 04:27 AM
Hi @Suzy
Have a look here:
What is the use case showing button after 4 days, better to drive this on stat eor updated field.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
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/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 04:30 AM - edited 12-19-2023 04:35 AM
Hi @Suzy ,
You can call a script include in ur UI action & place this code in it n try if it works.
// This script assumes you have a field named 'sys_created_on' that represents the creation date
var caseCreatedOn = new GlideDateTime(current.sys_created_on); // Replace 'sys_created_on' with the actual field name
// Set the escalation threshold to 48 hours
var escalationThreshold = 48 * 60 * 60 * 1000; // 48 hours in milliseconds
// Calculate the time difference between now and the case creation date
var timeDifference = gs.nowDateTime().getNumericValue() - caseCreatedOn.getNumericValue();
// Check if the time difference is greater than or equal to the escalation threshold
if (timeDifference >= escalationThreshold) {
// UI action should be visible when this condition is true
return true;
} else {
// UI action should be hidden when this condition is false
return false;
}
Thanks,
Danish