Tag Archives: UserInput

SCSM workflow to add UserInput to work item description

I often get the question from customers that are using SCSM how can we get the user input to the description. Out-of-the-box SCSM will place this in a field called UserInput.

This can be frustrating for some customers because they want to be able to send out an email like this”your request is now registered with the following information”. We would just use the normal email templates and add UserInput it would look something like this.

This is not a very good formatting to use in a email to the end-user. Therefor i have created a SCSM PowerShell workflow that will check for all new SR and IR if they contain any UserInput and if it does it will add that to the description. If there already is a description the UserInput will be added below that text. So if we look at the example a before it will look like this instead.

Now this is much better for an end-user to read. The solution will take all the questions on every request offering there is in the system and add it to the description. The solution is not sealed so feel free to modify the code to fit your need.

Below is a code snip from the service request part where i will explain what i am doing.

First we get the service request object so we have something to work with.

Save the UserInput to a variable

We need an array to save all the question with answers so we call that one $UserInput and we have to check if there is a description already. If it is save it to the userinput array.

The next step is to go throw the Questions in the XML-code. We are doing a split to get each question/answer to a row and then go row to row and extract the information we need. And save the question with answers to the array  $userinput

The last step is to add all information saved in $userinput to the description on the work item.

Tip: If you want to send out an email with your case is now registered in our system i recommend to modify this workflow some. Make the workflow set a tag in the SR class for example and when that value is met you can trigger a new workflow to send out an email.

Why should i do this? If you have an email subscription with criteria send on object created the email can be sent before the user input workflow has run and you don’t get a complete description to the end-user.

This function is not excessive tested so it’s up to you to test it and find possible bugs. The full code is available at Technet gallery, Click here for a link