how to calculate fulfilment time of a request

Arun61
Tera Contributor

need to extract a report that how many days it takes to fulfill a request.

can anyone help on this.

 

 

1 ACCEPTED SOLUTION

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @Arun61 ,

 

You can make use of duration field from sc_request table and calculate the fulfillment duration. But that field is from task table so you can either create own field for this and use calculated value as below :-

Field Type : Duration

GunjanKiratkar_1-1668663876049.png

(function calculatedFieldValue(current) {

	// Add your code here
	var startDate = current.closed_at.getDisplayValue();
    var endDate = current.sys_created_on.getDisplayValue();
	return gs.dateDiff( endDate, startDate,false);  // return the calculated value

})(current);

 

Report :-

 

GunjanKiratkar_0-1668663762579.png

 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

View solution in original post

2 REPLIES 2

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @Arun61 ,

 

You can make use of duration field from sc_request table and calculate the fulfillment duration. But that field is from task table so you can either create own field for this and use calculated value as below :-

Field Type : Duration

GunjanKiratkar_1-1668663876049.png

(function calculatedFieldValue(current) {

	// Add your code here
	var startDate = current.closed_at.getDisplayValue();
    var endDate = current.sys_created_on.getDisplayValue();
	return gs.dateDiff( endDate, startDate,false);  // return the calculated value

})(current);

 

Report :-

 

GunjanKiratkar_0-1668663762579.png

 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

When i go to Dictionary - New, from table "Request[sc_request]", type "Duration", label and name it, i click on the calculated Value table i cannot change the calculated check box.  any ideas?  6DSFbFI - Imgur.png