New PowerShell Script to Create a Service Request from an Incident

New PowerShell Script to Create a Service Request from an Incident

  • Comments 7
  • Likes

ITIL v3 defines an incident as "an unplanned interruption to an IT service or a reduction in the quality of an IT service. Failure of a configuration item that has not yet impacted service is also an incident." A service request is defined as "a request from a user for information, or advice, or for a standard change or for access to an  IT service."

Sometimes a work item may be initially filed as an incident, but later is determined to really be a service request.  In Service Manager it is not possible to change the type of a work item.  Once an incident is created it will always be an incident.  It cannot be changed to a service request.  To make it easier to create a service request from an existing incident, Andre Carter from Microsoft Australia has created a PowerShell script that creates a new service request from on an existing incident and copies properties of the existing incident into the new service request.  The script will also cancel the incident and create a reference to the newly created service request.

In detail the script performs the following actions:

1.      Copies the incident source to the service request source (e.g. E-Mail, Portal, etc.)

2.      Copies title, description, and urgency from the incident to the service request

3.      Adds a related work item reference to connect the incident and service request

4.      Cancels and closes the incident with a comment that indicates it has been replaced by a service request (with service request ID)

5.      Starts the service request description with “[Formerly Incident #]”

Additional incident properties can easily be added to the list for copy to the new service request by editing the script.

The script can be run manually from a PowerShell prompt or changed to run as a task in the SCSM console. If the script is copied into a task, the $IncID variable shall be set to the current incident.

The script is now shared on the TechNet Gallery:

Thanks for sharing with the community Andre!

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Interesting Powershell script, thanks for sharing!

  • Is there a similar script to create a  Change reguest from a Servicerequest?

  • When I try this, it works except the new Service Request does not have the "SR" in front of the ticket number.  What am I missing?  Thanks!!

  • The created SR is not shown in the console but available in the database.How to make it appear in the console?

  • I'm noticing the same issue as DonDraper1960. Service Request IDs in Service Manager are prefixed with SR, and the prefix is missing from the newly created Service Request.

  • Hi! Is there a way to do the opposite, an IR from an SR?

  • Hi, Please excuse me to self-promo, but I want to answer @Anonymous. We created a solution that convert IR to SR and vice-versa as a console task. Take a look