Share via


Automatically close incidents after x number of days

I had a request from a customer that the would like a workflow to close all resolved incidents, 7 days after they were resolved.

Several solutions exists on the internet, but I think this one is the most simple.

First you need to install the SCSM Powershell Cmdlets, as it includes a cmdlet called Get-SCSMIncident and Set-SCSMIncident. You can download it here, just follow the guide on how to install it on your SCSM Server. 

 

  1. Start the Service Manager Authoring Tool. (Download it here, and make sure you have the latest SCSM CU applied)
  2. Create a new management pack, for example Close.Resolved.Incidents
  3. Rigth click Workflows and select Create
    1. Name: Closed_Resolved_Incidents
    2. Trigger: Run at Scheduled time
    3. Schedule: Everyday at 10:00 PM
  4. Drag and drop the “Windows PowerShell Script” activity from the activities toolbox to your workflow
  5. Name the script CloseResolvedIncidents

 

 

6. In the Details pane, click “..." in the Script body

7. Insert the following script:

Import-Module SMLets

Get-SCSMIncident -Status Resolved -InactiveFor 7.0:0:0 | Set-SCSMIncident -Status Closed -comment “Autoclosed after 7 days of being inactive and resolved”

Note: -InactiveFor 7.00:00:00 is a Powershell-TimeSpan and therefore means Days.Hours:Minutes;Seconds. You can change to InactiveFor to what timespan you need.

8. Save the Management Pack

9. In the Folder where you saved the Management pack, you will also have a dll-file located, for this example Closed_Resolved_Incidents.dll, copy the dll to C:\Program Files\Microsoft System Center\Service Manager 2010 directory on your Management Server

10. Import the management pack into Service Manager, either via the console or Powershell

11. Whenever you have scheduled the workflow to run, goto Administration, Workflows and check the status.

This will now run once a day and close all resolved incidents that have been inactive for e.g 7 days. The comment will be added as a an Analyst Comment.

Recently Cireson released a free MP that allows you to do the same, including SR, PR, CR and RR, and also with the ability to scheduled the workflow within the console. So if you don't want to created the MP, try to have a look at this one: https://www.cireson.com/app-store/scsm-auto-close/

Comments

  • Anonymous
    March 28, 2014
    The comment has been removed
  • Anonymous
    March 28, 2014
    The comment has been removed
  • Anonymous
    April 14, 2014
    The comment has been removed
  • Anonymous
    April 30, 2014
    Hi, i made a workflow to set status closed with a comment, however the private attribute is set to null and no mail with a comment is sent to the user. Any way to set private to not null or false?
  • Anonymous
    January 22, 2015
    The comment has been removed
  • Anonymous
    November 12, 2015
    Great post from your hands again. I loved the complete article.
    By the way nice writing style you have. I never felt like boring while reading this article.
    I will come back & read all your posts soon. Regards, Lucy.
  • Anonymous
    November 27, 2015
    Thanks for the great info. I really loved this. I would like to apprentice at the same time as you amend your web site, how could i subscribe for a blog site?
    For more info on showbox please refer below sites:
    http://showboxandroids.com/showbox-apk/
    http://showboxappandroid.com/
    Latest version of Showbox App download for all android smart phones and tablets. http://movieboxappdownloads.com/ - It’s just 2 MB file you can easily get it on your android device without much trouble. Showbox app was well designed application for android to watch movies and TV shows, Cartoons and many more such things on your smartphone.
    For showbox on iOS (iPhone/iPad), please read below articles:
    http://showboxappk.com/showbox-for-ipad-download/
    http://showboxappk.com/showbox-for-iphone/
    Showbox for PC articles:
    http://showboxandroids.com/showbox-for-pc/
    http://showboxappandroid.com/showbox-for-pc-download/
    http://showboxforpcs.com/
    There are countless for PC clients as it is essentially easy to understand, simple to introduce, gives continuous administration, effectively reasonable. it is accessible at completely free of expense i.e., there will be no establishment charges and after establishment it doesn't charge cash for watching films and recordings. Not simply watching, it likewise offers alternative to download recordings and motion pictures. The accompanying are the strides that are to be taken after to introduce Showbox application on Android. The above all else thing to be done is, go to the Security Settings on your Android telephone, Scroll down and tap on 'Obscure sources'.