How to store the business hours since the incident was last updated?

nayanmule
Tera Expert

Hi All,

 

I want to store the business hours in some field since the incident was last updated. 

For example if incident was last updated 2 days ago, I want to add that time in business hours & store it in some field. 

So, here the field will store the value as (9x2 = 18 hours) . 

 

Any help will be appreciated.

 

Thanks 

Nayan Mule

10 REPLIES 10

@nayanmule 

please share what script did you try and what didn't work

what debugging have you done from your side?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

I have used the same code you have given, but business hours is not getting calculated.

nayanmule_0-1737388532720.png

 

@nayanmule 

what debugging have you done so far and what's your analysis?

Recently I shared solution for something similar, check that

calculate Duration and Business Duration in scoped application 

also check these links

subtract time from schedule to update task due date 

Calculate Date By Adding or Subtracting Time With A Schedule 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@nayanmule 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar  ,

 

Unfortunately, I wasn't able to get the expected value.