Background: Altiris Helpdesk Solution 6.0 has a "Time Spent" feature which tracks the amount of time the incident has been edited. This does not necessarily give an accurate measure of the amount of time taken to resolve an issue since the time is only calculated while the incident is being edited.
Question: Is there a way to calculate the difference from the time the incident was logged to the time it was resolved and display this in the incident?
To record the time to resolution, use an Incident Rule to add the time to resolution to the comment field. The Incident Rule triggers when the incident status changes to Closed or Resolved.
In this example, the incident rule will trigger when the incident status is changed to Closed. The steps are as follows:
- Create a new Incident Rule from the Admin menu in the Helpdesk console and configure a name and comment of your choice.
- In the "Set these properties:" section of the form, choose to set the Comment to the following:
[b]Time to resolution[/b]
= HDQUERY[[select DATEDIFF(mi,[workitem_created_on],[workitem_modified_on]) From [Workitem_Current_View] where
workitem_number = WORKITEM(workitem_number)]] minutes
- workitem(workitem_comment)—Using this Macro, we are preserving the original comment instead of overwriting it.
- [color=blue]-------------------------------------[/color]—creates a separation between the original comment and the following text
- [b]Time to resolution[/b]—Inserts the words "time to resolution" in bold text.
- HDQUERY—Using the Helpdesk Query macro, we are comparing the difference in minutes between the time in the incident was created and the time it was last modified. Since this will occur when the incident is closed, the last modified date will be the close date.
- In the "When:" section of the form, choose "Every time Incident is saved".
- In the "And:" section of the form, choose "Status" changes and is equal to "Closed."
- Under normal conditions, this rule will not be Terminal.
The result of this incident rule will cause the following text to be appended to the final comment whenever the incident is closed: