Tracking of duration/business duration for Catalog Tasks

priya0895
Giga Contributor

Hi, 

Need to track Catalog Task duration and business duration but this information is not currently being recorded at the task level and resides at the RITM level.  Please assist as to what needs to be done to take this forward. 

Thank You,
Priya

8 REPLIES 8

Hi again,

If you look at the incident BRs, you'll find one called mark_resolved.  That is what sets the duration values when the incident is resolved.  sc_task doesn't have a resolved state but it does have three closed states. 

I haven't tested this but it should work... try copying the code from incident.mark_resolved that sets the durations into sc_task.mark_closed.  Since both incident and sc_task extend task, that should work for you.

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

 

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Hi John , 

 I am able to replicate the BR and this works to fetch me the duration for those tasks which are closed complete/Closed incomplete. 

However i want the duration for even those which are open and in progress as i want to get a report of tasks which are open from last 5 days from current date and also how much time has assignment group has utilized on the tasks.

Any inputs how to proceed on that?


Thanks and Regards
Priya Sharma

Hi Priya,

You can accomplish half of what you need by just setting up a report that looks for tasks using the selection criteria:

state is in progress and created at or before 5 days ago

Using just in progress won't show you any that are opened, assigned to a group but not a person, state = new.  It also will not show you any that are on hold.  I know that in some shops, on hold is a way of saying I can forget about this one until I hear from the user/vendor/etc. You can add any of these by expanding the criteria for state.

What I did to better understand how long a given assignment group has had the item, a reasonable surrogate for duration, is add a field to the task table that I call Assigned To This Group.  I created a simple BR on task that fires after insert and after change when the assignment group changes.  The script for that goes something like this:

var rightNow = new GlideDateTime();
current.u_assigned_to_this_group = rightNow;
current.update;

Once you start populating the field, you can use that as criteria for duration, e.g. Assigned To This Group at or before 5 days ago.

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Hi John, 

 This is helpful but there is one issue still to encounter and that is the 5 days ago filter counts the weekends too however i wish to excvlude weekends or holidays in the count. 

I wish to get the list of all open tickets excluding the last 5 business days from today.

Any inputs?

Thnaks and Regards
Priya Sharma