Calculate time between incident creation and when service offering field is updated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 03:46 AM
Hi, need a method to report incidents assigned to the Service Desk where the Assignee took more than 4 hours to update the service offerring field.
Calculation should be time difference between service_offering field is updated and incident was created(sys_created_on )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 05:18 AM
Hello @Doraemon
If it's for reporting purpose, you might need to create a custom field and store the duration there.
Now how can you populate that custom field with the duration of difference between service offering first populated and created time - you can go by business rule - in this situation it fits well.
Trigger conditions can be service offering changed from empty to not empty or anything.
Then you can store the time the field changed. And use GlideDateTime.subtracf() method to get exact duration - the parameters here will be both date time type - so no hassle.
Kindly mark my answer as helpful and accept solution if it helped you in anyway,
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY