Incident - difference between 'business_stc' vs 'calendar_stc' fields

SB87
Tera Expert

Hi,

Can someone explain the differences of the 'business_stc' vs 'calendar_stc' on the Incident table?

An API response is returning the following:

"business_stc": "115200",

"calendar_stc": "380400",

Thanks in advance.

 

 

1 ACCEPTED SOLUTION

jaheerhattiwale
Mega Sage
Mega Sage

@SB87 

business_stc is "Business Resolve Time" - Duration in milliseconds in which the incident is resolved (Considering only business days, ignoring the holidays)

 

calendar_stc is "Resolve Time" - Duration in milliseconds in which the incident is resolved (Including holidays)

 

Please mark as correct answer if this has helped you

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

View solution in original post

5 REPLIES 5

Community Alums
Not applicable

Hi @SB87 ,

The Resolve time and Business resolve time field are available on the Incident [incident].

This field allows for easy reporting on how long it takes for Incident to be closed, and is stored as an integer number of seconds.

Specific business rules calculate the Resolve time field when the record is resolved or marked closed, and measure the difference between the Opened and Closed dates.

On the Incident table, the field is calculated on the incident resolution, or closure, whichever happens first, based on the business rule mark_resolved or mark_closed. Both are based on the Incident table to get a trigger.

When the incident is resolved, the calculation is based on the mark_resolved business rule.

Resolve time - calendar_stc uses "dateDiff" function for calculating different of the duration between opened and resolved.

Business resolve time - business_stc uses the "calDateDiff" function for calculating different of the duration between opened and resolved.

dateDiff(String, String, boolean):-
Calculates the difference between two dates independent of the calendar.

calDateDiff(String, String, boolean):-
Calculate the difference between two dates using the default calendar, so depending on the calendar the duration between the time is calculated. So that the reason "Business resolve time" value can be "0" when the incident is opened and closed when the time won't fall in the calendar.

The calendar is defined in System Policy -> Calendars.

Hi Sandeep,

Thank you for your reply.

Just to ensure I'm understanding this correctly:

  • Both Resolve time and Business resolve time are fields found on the Incident table.
  • Both record the time in seconds (as an Integer) for the Incident to be closed.

What I am unclear about if the following statements:

...when the record is resolved or marked closed, and measure the difference between the Opened and Closed dates.

My understanding is that an Incident would be placed in a 'Resolved' state first before it is closed (e.g. there could be a rule in place that automatically closes a resolved incident after x amount of days of it not being reopened). Can you provide a scenario when an Incident will be closed, first?

 

Also, you mention:

When the incident is resolved, the calculation is based on the mark_resolved business rule.

  • Resolve time - calendar_stc uses "dateDiff" function for calculating different of the duration between opened and resolved.
  • Business resolve time - business_stc uses the "calDateDiff" function for calculating different of the duration between opened and resolved.

But both examples seem to do the same thing based on your explanation, except using a different function. 

 

On further reading, I discovered the following:

  • dateDiff(String, String, boolean) = Calculates the difference between two dates. This method expects the earlier date as the first parameter and the later date as the second parameter; otherwise, the method returns the difference as a negative value.
  • calDateDiff(String, String, boolean) = Calculate the difference between two dates using the default calendar.

If I refer back to my original post, I provided two examples:

  • "business_stc": "115200",
  • "calendar_stc": "380400",

Are you able to explain in layman terms what the difference is from a business perspective? i.e. does the business stc account for time spent during business hours while the calendar doesn't (e.g. it includes time outside a business's operating hours)?

 

Kind regards,

 

 

jaheerhattiwale
Mega Sage
Mega Sage

@SB87 

business_stc is "Business Resolve Time" - Duration in milliseconds in which the incident is resolved (Considering only business days, ignoring the holidays)

 

calendar_stc is "Resolve Time" - Duration in milliseconds in which the incident is resolved (Including holidays)

 

Please mark as correct answer if this has helped you

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

Thank you, this was clearly explained.