Home » System Center Service Manager » Merge two incidents

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.


11 Comments

  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?

    thanks,
    phu

  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.