If the system property com.snc.time_worked.update_task_timer is set to true, the business rule 'Update task timer' creates a new empty record in the task table when deleting an incident. That new task record has the same sys_id as the deleted incident.
As a result, the incident cannot be undeleted (from sys_audit_delete). Trying that will result in the error:
Unique Key violation detected by database (Duplicate entry '962cfe3c0f3572006939fa6ce1050eae' for key 'PRIMARY')
Steps to Reproduce
1 Set the property com.snc.time_worked.update_task_timer to true
2 Open the Incident form.
2.1 Make the time_worked task field visible
2.2 OR make the task_time_worked related list visible
2.3 Optionally also add the 'Time worked' field to the form so that any update in the incident automatically generates a task_time_worked record in the related list (every time the incident gets saved).
3 Open an existing incident.
3.1 Click the New button in the task_time_worked related list.
3.2 OR add updates in worknotes if the 'time worked' field was added as well.
4 Save and update the incident.
5 Search and query the updated incident from a task list view.
6 Right click on the incident number and copy its sys_id
7 Open task.LIST (in a new tab) and query the record for that sys_id
8 Verify it is listed as an incident.
9 From the first incident list view (in step 5) select the record and delete it through the actions menu.
10 Verify it is no longer in the list.
11 Refresh the tab from the task.LIST. The new run query will show it is not a TASK record.
11 Open sys_audit_delete.list
12 Find the deleted incident and try to undelete it. You will get the error reported above.
This problem was fixed in Jakarta. On an older release perform the following:
The changes in the script compared to the out-of-box one are:
Related Problem: PRB908462