Home » System Center Service Manager » Merge two incidents


Welcome to contoso.se! My name is Anders Bengtsson and this is my blog about Azure infrastructure and system management. I am a senior engineer in the FastTrack for Azure team, part of Azure Engineering, at Microsoft.  Contoso.se has two main purposes, first as a platform to share information with the community and the second as a notebook for myself.

Everything you read here is my own personal opinion and any code is provided "AS-IS" with no warranties.

Anders Bengtsson

MVP awarded 2007,2008,2009,2010

My Books
Service Manager Unleashed
Service Manager Unleashed
Orchestrator Unleashed
Orchestrator 2012 Unleashed
Inside the Microsoft Operations Management Suite

Merge two incidents

I have seen the question at Technet forums a number of times, is it possible to merge to incidents? In this post I have built a idea how to do it. When you run it you input two incident numbers. The first number  is the incident that you want to keep, and the second number is the incident that you want to close. The script will move all comments from the action log in the first incident to the second, so your comments will be moved to the incident that will be keep open. This solution require smlets that you can download here.

I made some notes about how it works…

It includes a couple of scripts

  • MergeInc.vbs, main vbscript
  • GetComments.ps1, powershell script that export comments from the incident that you want to close. All comments are stored in C:\temp\export.txt
  • UpdateIncident.ps1, powershell script that update the incident that you want to keep. It will be updated with all the old comments, in one large private comment in the action log
  • CloseIncident.ps1, powershell script that will close the incident that you don’t want to keep anymore

You can run MergeInc.vbs as a task from the console, the same way I do with a script in this post. You could of course pick up a incident ID from the console when you run the console. In this example I have two incidents, IR67 and IR69. For some reason IR69 is a double of  IR67 so we want to move the comments from IR69 to IR67 and close IR69.

Run the task and input IR69 and IR67.

Then IR69 is now closed and there is a comment in the action log

and if we look at IR67 the action log is now updated with all the old comments from IR69

It is not a optimized enterprise ready solution but it works. You can download my scripts here, Merge.


  1. Thanks Anders, looks like a codeplex project to me! Let me see what we can do here in San Diego.

  2. “I think because in GetComment.ps1 it can’t out-file export.txt”

    Same problem here…
    Any fix?

  3. Hi, thanks for reading my blog. I have not test it for a while so I think we should test it with latest version of SMLET to be sure. But today I would also look into doing it with Orchestrator/Opalis instead.

  4. Anders,

    Does this script need to be updated to reflect SMLET changes or will it work with the most current version?

  5. hi,

    I’m trying run MergeInc.vbs but receive a error: C:\Merge\MergeInc.vbs(33, 1) Microsoft VBScript runtime error: File not found

    I follow this steps:
    1/ Create folder C:\Merge to contain your files
    2/ In GetComments.ps1,UpdateIncident.ps1, CloseIncident i replaced “Add-PSSnapin smcomlets” to “Import-Module smlets”
    3/ And in GetComments,MergeInc i replaced “C:\temp\export.txt” to “C:\Merge\export.txt”

    I think because in GetComment.ps1 it can’t out-file export.txt
    What wrong?


  6. The merge seems to delete the old incident and simply add a log to the incident to be merged – where can I find the details of the old incident (e.g. description) in the merged/updated one?

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.