Creating a change request in Service Manager from a web application



Say you want to provide a form in your intranet portal that allows end-users to be able to create standardized change requests in Service Manager. Let’s say that the form captures all needed input from the requesting user. This would allow you to automate the entire process of service delivery without any user interaction except from the end-user filling out the form.

This post can also be seen at the official Service Manager blog

In this example I’ve used the solution provided by Travis Wright in his blog post “Extending Service Manager to Automate IT Processes”. I’ve created a web form that will allow a user to create a change request in Service Manager based on a template containing the activity “Automated Activity: Provision New User”. As a result an end-user with suitable permissions in Service Manager can request a user account (including things like mailbox, standard Active Directory group membership) from the company’s intranet portal, the account is automatically provisioned and whole process is tracked inside Service Manager. You can find the complete solution and detailed instructions on how to build it yourself in the provided zip archive.
Note: You need to implement the example management pack from “Extending Service Manager to Automate IT Processes” to make this work.

Here is the introduction/summery of the solution.  The full document is provided as an attachment here in the bottom of the post.

How it was built

  1. Using Visual Studio I’ve created a new “ASP.Net Web application”.
  2. I added a reference to the Service Manager SDK assemblies. In this example there is only one needed and that is the “Microsoft.EnterpriseManagement.Core.dll”.

    By referencing the Service Manager SDK assemblies you can instruct Service Manager do pretty much anything that you can do in the console from a custom application.
  3. I’ve created a form with suitable input controls.
  4. Since I wanted to automate the user provisioning based on the example “Extending Service Manager to Automate IT Processes”, on the click event of the submit button I:
    1. Create a change request
    2. Set the “CreatedBy” property of the change request (since I want to be able to see who created the change request from the web application)
    3. Apply the change request template that contains the activity called “Automated Activity: Provision New User”
    4. Set the property values of the activity to the values captured in the web application form

Test the application

  1. Implement the solution provided by Travis in his blog post “Extending Service Manager to Automate IT Processes”.
  2. Download the zip file provided with this post
  3. Open up “SCSMWeb\SCSMWeb.sln” in Visual Studio (or follow the step-by-step guide to build your own application)
  4. Make sure that you pointed out your Service Manager server in the string called “smServer” in Default.aspx.cs
  5. Press F5 for debug in Visual Studio
  6. Fill out the form and press “Submit”
  7. Open up your Service Manager console
  8. Go to “Work Items” – “Change Request” – “All change requests” and look for a change request with the title “Automatically Provision New User”.
  9. Open up the change request and notice how the Created By property is set to the user object representing the user who made the request.
  10. Go to the activities tab and open up the activity called “Automatically Provision New User” and notice that the values you filled out in the form now are stored in the activity object related to the change request.
  11. Close the forms. Now, if you had the example “Extending Service Manager to Automate IT Processes” working before you started adding the web application, you should be able to find a new user object in your Active Directory just as if you had created the change request using the correct template and the activity form inside of the Service Manager console instead of your new web form.

I hope I’ve got your thoughts going, using the Service Manager SDK we’re able to give the end users the possibility to do a lot of the work that is normally done in the help desk. By using workflows for automating the service delivery part of the processes and providing self service for the end user, we can offload the help desk and increase the quality of our service.

The full solution and documentation can be downloaded here:

Good Luck!

Leave a Reply