- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2014 07:49 AM
Hello,
I have a requirement from management asking for a list report showing up-to-that-minute aging of all open/active Catalog Tasks. In other words, they want to be able to see how long (duration) since the task was created, regardless of the current task state.
I already provided them a chart showing the date ranges, but that's not what they want to see.
Has anybody done this...? Any ideas on how to accomplish it...?
Thank you in advance.
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2014 08:58 AM
Hi Abel,
Not a problem. I would actually create a new field rather than using the Duration field itself. Here's the approach:
1. Personalize the form
2. From the Create New Field in the bottom right, select Duration from the type and give the field a name
3. Click Add to add the field to the form, position it and click Save
4. From the form, right click the field and click Personalize Dictionary.
5. Click the Read Only checkmark, click the Calculated checkmark
6. In the calculated field, enter the following:
gs.dateDiff(current.opened_at.getDisplayValue(), new GlideDateTime().getDisplayValue());
That ought to work.
Setting the Duration Field Value - ServiceNow Wiki
GlideDateTime - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2014 08:54 AM
for a calculated duration field it would be to create a glide duration field, set it as calculated and set the calculation to
current.calendar_duration = gs.dateDiff(current.sys_created_on.getDisplayValue(),gs.nowDateTime(),false);
however i would think that in this case the sla duration is the right answer... and work on the sla definition to ensure the clock starts when the task is created and there are no unexpected pause conditions...
i would suggest this because i think their next step is going to be to want some kind of alert on items that are close to over the expected duration etc...
the issue with throwing an sla on a catalog task is you want to somehow link the SLA to the duration of the task itself....
we acomplished this by retasking the priority field so we have catalog task SLA's defined for each type of duration we have in tasks <1 business hour, 1 bd, 2 bd's, etc>
we then set on the catalog task table choice options for priority of each of those durations...
on the catalog task we can then set the priority to the duration.. and in the sla definition the start condition is the same...
so for example if the duration of the task is 9 hours... we set the priority on the task to 9 hours and the sla start condition on the catalog task table and start condition of priority of 9 hours...
we did this because we couldn't get the sla's to actually trigger on the duration field on catalog tasks in berlin release and the priority field is not being used on catalog tasks and exists on the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2014 08:58 AM
Hi Abel,
Not a problem. I would actually create a new field rather than using the Duration field itself. Here's the approach:
1. Personalize the form
2. From the Create New Field in the bottom right, select Duration from the type and give the field a name
3. Click Add to add the field to the form, position it and click Save
4. From the form, right click the field and click Personalize Dictionary.
5. Click the Read Only checkmark, click the Calculated checkmark
6. In the calculated field, enter the following:
gs.dateDiff(current.opened_at.getDisplayValue(), new GlideDateTime().getDisplayValue());
That ought to work.
Setting the Duration Field Value - ServiceNow Wiki
GlideDateTime - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2015 01:40 AM
This is fantastic, how would i get the timer to stop when the task becomes inactive?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 08:08 AM
you would need to set two calculation scripts...
if the active is true.. calculate it as above.. if active is false calculate it as date closed - date opened... <basically the same script you are just using the date closed instead of the now date time.>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 02:42 PM
How would that be coded, sorry, JavaScript is not one of my strong points. Thanks in advance