Skip to content

Conversation

chetnadev
Copy link
Contributor

This Business Rule in ServiceNow is used to track how long it takes to assign a record after it is created, typically on a task table like Incident, Change, or a custom table.

If this is the first time the record is being assigned (i.e., u_assigned_time is empty):
Sets the field u_assigned_time to the current time.
Calculates how many minutes passed since the record was created (sys_created_on).
Stores that difference in a custom field u_time_to_assign (as a string like "15.33 minutes").
If the record was already assigned before (u_assigned_time is not empty), it just logs that and does nothing.

While this is possible to do via Metrics in ServiceNow (https://www.servicenow.com/docs/bundle/xanadu-platform-administration/page/use/reporting/concept/c_SampleFieldValueDurationScript.html), the script is being provided to potentially solve some edge cases.

@WillemZeiler WillemZeiler self-assigned this Oct 5, 2025
@WillemZeiler WillemZeiler merged commit 13e7377 into ServiceNowDevProgram:main Oct 5, 2025
2 checks passed
@WillemZeiler WillemZeiler added the help wanted Extra attention is needed label Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants