Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.
Endpoint Management Community Blog

How to Modify SD.CloseIncidents to Work with Subtasks?

Created: 10 Apr 2012 • Updated: 10 Apr 2012 • 1 comment
toomas's picture
0 0 Votes
Login to vote

The SD.CloseIncidents that comes with ServiceDesk 7.1 SP2 does not work with Incidents that have subtasks. Incident datatype only includes one of the TaskIDs and only one task will be closed. This will also mess up the incident a bit.

The project can be modified to include a loop through all the tasks that are part of this process and send a closing message to each of these. The approach is rather brute force one, as it does put messages in the queue for all the tasks that were in the incident, including closed ones. However, Workflow does seem to properly clean it up afterwards either way, based on my quick testing.

This is only one way of achieving this, I do not claim it to be the best or most efficient way.

All the usual disclaimer things apply:
- Don't do this in your production ServiceDesk before testing it.
- Consider this an idea or example.
- It is a customization and is not supported.

Customize the SD.CloseIncidents project:

  1. Go to 'Model [3]: Action Model'
  2. Add a 'Get Task Assignments For Process' component after 'Create Close Message (3.9)' (and before 'Close Incidents (3.6)') with these settings:
    - Uncheck Use Current Process
    - Tracking ID: Incident.Tracking_id
  3. Add a 'For Each Element in Collection' component after that with these settings:
    - Array Variable Type: LogicBase.Core.Ensemble.WorkflowTasks.TaskAssignment
    - Array Variable Name: resultTaskAssignments
    - Item Output Variable Name: tItem
  4. Connect the 'next element' path from 'For Each Element In Collection' to 'Close Incidents (3.6)'.
  5. Connect the outbound path from 'Create Log Entry (3.3)' to 'For Each Element In Collection'.
  6. Connect the 'finished' path from 'For Each Element In Collection' to 'For Each Incident In Selection (3.5)'.
  7. Modify the 'Close Incidents (3.6)' component:
    - Task ID: tItem.TaskID
  8. Optional: Modify the 'Create Log Entry (3.3)' component
    - Log Entry Level: Error
    Log Entry Text: Closing Message has been sent to the following incident task ID: [tItem.TaskID] (assigned to [tItem.ReferenceName])

I would keep the log entry in step 8 at Error level and an assignee name in there just so you will be able to keep an eye on what tasks get affected. After some testing when you're sure this works, change its level back to Warn.

Screenshot of the resulting workflow is attached.

Comments 1 CommentJump to latest comment

paro's picture

Nice post Toomas.

Is there a way to modify this so that it includes tickets from the Email Management process (EM-xxxxxx). 



Project Manager / Founder
Asterio AB, Sweden

Login to vote