Create a business age metric for problem record

Rohith Sureshk1
Tera Contributor

hi,

 

we have a requirement to create a business age of problem metric. [ Business age = Total Age of Problem - Known error duration].  We are stuck in subtracting the duration field. Can anyone let me know how can we subtract two duration fields, get result of that and put that result in another duration field.

 

Thanks

Rohith

2 REPLIES 2

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
You can use below logic.

var duration = new GlideDuration('3 12:00:00');
var duration2 = new GlideDuration('3:00:00');
var answer = duration.subtract(duration2);
gs.info(answer.getDisplayValue());

 

C

If the provided solution meets your needs, kindly consider marking it as helpful and accepting it as the solution. This helps others who may have similar questions.

 

 

 


Thanks and Regards,

Saurabh Gupta

Hi @Rohith Sureshk1 

C

If the provided solution meets your needs, kindly consider marking it as helpful and accepting it as the solution. This helps others who may have similar questions.


Thanks and Regards,

Saurabh Gupta