How to get Business Duration of RITM's in reports

rkreddy
Giga Expert

Hi All,

Hope everyone is staying safe.

I am seeing the business duration of RITM having blank values. How can I get these values.

And I am leaner of Service-now. I wish to know that, how the process works like closing the catalog tasks will close the RITM and request as well. Is there any OOB BR's or workflow?

Your suggestions help me to learn.

Regards,

Rakesh.

1 ACCEPTED SOLUTION

Suseela Peddise
Kilo Sage

Hi,

OOB functionality already available on Incident table. Please go through 'mark_closed' business rule on incident table . Use this logic and built new business rule on RITM table to calculate business duration field.

find_real_file.png

Hope this helps.

 

If I have answered your question, please mark my response as correct and/or helpful.

Thanks,

Suseela P.

View solution in original post

12 REPLIES 12

Suseela Peddise
Kilo Sage

Hi,

OOB functionality already available on Incident table. Please go through 'mark_closed' business rule on incident table . Use this logic and built new business rule on RITM table to calculate business duration field.

find_real_file.png

Hope this helps.

 

If I have answered your question, please mark my response as correct and/or helpful.

Thanks,

Suseela P.

Hi Suseela,

Thank you. Will try and update.

Hi Suseela,

It is working fine for newly created ritms after creating BR. But, how can we get the business duration for previously completed RITM's.

Thank you.

Hi Rakesh,

You can run fix script or background script to update the business duration field on closed RITMs.
For ex:

var qry="active=false^closed_atISNOTEMPTY'';//update the query to retrieve closed RITMs

var gr= new GlideRecord('sc_req_item');

gr.addEncodedQuery(qry);

gr.query();

while(gr.next()){

var opened= gr.opened_at.getDisplayValue();

var closed= gr.closed_at.getDisplayValue();

if(gr.business_duration==''){

gr.business_duration=gs.calDateDiff(opened,closed,false);

gr.update();

}

}

Hope this helps.

If I have answered your question, please mark my response as correct and/or helpful.

Thanks,

Suseela P.