An entry showing under Time worked related list with a high time work value is present on many incidents when the incident is created from Alert.



Noticed that the behavior you see is as per the design that the "Time worked" value on Incident will show greater than "0" when an incident is created from the Alert for which there is already an Incident associated.

Here is how the flow goes:-

When an "em_alert" record is reopened the below OOB After - Business rule is triggered, which is used to Reopen associated closed incident.
Reopen associated closed incident - https://<instance-name>.service-now.com/sys_script.do?sys_id=31fe8a23eb2211004d7763fba206fe0f

The business rules call the script include "EvtMgmtAlertManagementAlertReopenHandler". Wherein a function "createNew", the data from the old incident is copied and created a new incident, which includes the value from "time_worked" is also copied to the new Incident. So that the reason the "Time worked" value on the new incident created on reopening of alert has the value greater than "0".
EvtMgmtAlertManagementAlertReopenHandler - createNew function

The OOB After - Business rule on the Task table is used to create "task_time_worked" for the task records.
This will get the value from "time_worked" on task record and create the 1st time worked record with the value.
As the value of "time_worked" on Incident is copied from the previous Incident, so the same value is display at the 1st "task_time_worked" records.
Task Time Worked - https://<instance-name>.service-now.com/sys_script.do?sys_id=c068b268c61122b700985016ce770871

The task_time_worked record will have no value from the Incident records when its created from alert which has no incident associated.


You will need to create a before business rule to set the "Time worked" value on Incident to have 0 during the insert of the incident record.

This will set the "Time worked" value to 0 at the time of creation, so any "task_time_worked" records will not be created as the time worked on the incident is 0.

Additional Information

Steps to Reproduce:-

Open any alert

Close the "Incident" connected to this alert.

On closing, the Alert will be changed to Resolved.

Now reopen the alert, a new Incident will be created.

You will notice that there is a "time_worked" value that is copied from the old incident and there are a "task_time_worked" related records for the incident which is having the value from the previous incident.

Article Information

Last Updated:2020-02-04 19:11:22