Archive for: ‘March 2012’

Notify Assigned to when the Affected User updates an incident from the SSP in SCSM 2012

March 30, 2012 Posted by Stefan Allansson

There are already some great blogs about how to notify the “assigned to” user when an incident is updated by the affected user. Those explains how to do this with the Exchange connector or with the SSP for SCSM 2010.

The solution for the Exchange connector also works in SCSM 2012, but since there are a new SSP in 2012 we have to find another way to do it for the SSP.

In SCSM 2012 there is a field for user input and a button “Update request” for the affected user of an incident on the SSP. If the user updates the incident from the SSP, an entry will be added in the action log for that incident.

So to be able to notify the assigned to user that the incident is updated, we need to trigger on when a new End-User comment is added in the action log. To do that we have to create a relationship subscription in XML.
Thanks to Travis that has wrote this blog that describes how to do that:

To get this to work for the SSP I used the management pack that Travis have created and made some changes.
In the subscription I changed RelType from WorkItem!System.WorkItem.TroubleTicketHasAnalystComment to WorkItem!System.WorkItem.TroubleTicketHasUserComment and for TargetType I changed from WorkItem!System.WorkItem.TroubleTicket.AnalystCommentLog to System.WorkItem.TroubleTicket.UserCommentLog

I also made changes to the WriteActions. Instead of adding a notification template and a user to notify directly in the XML, I add an incident template that I have created. The only thing my template does is that it sets the UpdatedByEndUser to true.
There is a great blog from my colleague Anders Asp “A smarter way to notify the assignee when the affected user updates his incident” that describes the UpdatedByEndUser solution.

So when we add a template that changes the UpdatedByEndUser to true, and have configured the rest in Anders solution it will send an e-mail to the assigned to user.

Below is the management pack that I have used.
You need to change the GUID (A035C6E5-2ADA-334A-3D01-24F4398A5BB1) for the incident template to the GUID of the template that you want to use.
To get the GUID for your template, login in to your SQL Server and run this query against the ServiceManager database.(put in the display name of your template)

“select Objecttemplateid from ObjectTemplate where ObjectTemplateName=’DisplayNameOfYourTemplate’

<ManagementPack ContentReadable=”true” SchemaVersion=”2.0″ OriginalSchemaVersion=”1.1″ xmlns:xsd=”” xmlns:xsl=””>

<Name>Action Log Add Relationship Subscription</Name>
<Reference Alias=”Console”>
<Reference Alias=”NotificationsLibrary”>
<Reference Alias=”WorkItem”>
<Reference Alias=”ServiceManager.IncidentLibrary”>
<Reference Alias=”System”>
<Reference Alias=”IncidentLibrary”>
<Reference Alias=”Subscriptions”>
<Reference Alias=”Administration”>
<Category ID=”Category.ActionLogAddRelationshipSubscriptions.ManagementPack” Value=”Console!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack”>
<Category ID=”Category.ActionLogAddRelationshipSubscriptionRule” Target=”ActionLogAddRelationshipSubscriptionRule” Value=”Administration!Microsoft.EnterpriseManagement.ServiceManager.Rules.WorkflowSubscriptions” />
<Rule ID=”ActionLogAddRelationshipSubscriptionRule” Enabled=”true” Target=”ServiceManager.IncidentLibrary!System.WorkItem.Incident.WorkflowTarget” ConfirmDelivery=”true” Remotable=”true” Priority=”Normal” DiscardLevel=”100″>
<DataSource ID=”DS” TypeID=”Subscriptions!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule”>
<RelationshipSubscription RelType=”$MPElement[Name=’WorkItem!System.WorkItem.TroubleTicketHasUserComment’]$” SourceType=”$MPElement[Name=’WorkItem!System.WorkItem.TroubleTicket’]$” TargetType=”$MPElement[Name=’WorkItem!System.WorkItem.TroubleTicket.UserCommentLog’]$”>
<AddRelationship />
<WriteAction ID=”WA” TypeID=”Subscriptions!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction”>
<WindowsWorkflowConfiguration>                <AssemblyName>Microsoft.EnterpriseManagement.ServiceManager.Incident.Workflows</AssemblyName>
<WorkflowArrayParameter Name=”InstanceIds” Type=”guid”>
<WorkflowParameter Name=”IncidentTemplate” Type=”guid”>A035C6E5-2ADA-334A-3D01-24F4398A5BB1</WorkflowParameter>
<WorkflowParameter Name=”NotificationRulesEnabled” Type=”boolean”>False</WorkflowParameter>
<RetryExceptions />
<LanguagePack ID=”ENU” IsDefault=”true”>
<DisplayString ElementID=”ActionLogAddRelationshipSubscription”>
<Name>Action Log Add Relationship Subscription</Name>
<DisplayString ElementID=”ActionLogAddRelationshipSubscriptionRule”>
<Name>Action log entry added to action log</Name>


Here is a summarize of the steps that is needed for this: (since I use Anders solution for templates and workflows, there is a more detailed description how to do that in his blog

  1. Create an Incident Template with settings that you want to apply for an updated incident. This is the template that we adds in the management pack with a GUID. My template just changes the UpdatedByEndUser to true. I think this is a great solution to use, but you can also have a template that for example just change the status to updated.(read Anders blog to see the advantages with his solution)
  2. Create a workflow that triggers on when your template is added that will send an e-mail to the Affected User. (see more information in Anders blog)
  3. Copy my mp and change the GUID to match your incident template.
  4. Import the mp

In step 3 in Anders article where he adds a template for the Exchange Connector I use a template that doesn´t do any change at all. We don´t need to set the UpdatedByEndUser to true since that will be done by our mp when an End-User comment is aded to the action log )

Step 5 in Anders description where you creates two workflows is little special in 2012 or at least in my environment. I don´t know if it´s a bug or if it´s unique in my environment.
I can´t create the criteria changed from NOT EQUAL true for the UpdatedByEndUser.
I have to set criteria EQUAL and then change it to NOT EQUAL in XML after I have exported the mp.
If I then import the mp again it work as expected but when you look at the workflow in the console it still says EQUAL. If I export the management pack again I can see that it says NOT EQUAL in XML as it also should do in the console.

This solution doesn´t send a notify if the Affected User resolves the incident on the SSP by clicking “cancel request”. Because when they do that it doesn´t creates an End-User comment in the Action log, it will create a “Record Resolved” entry instead. If I find a good solution for how to cover that I will create a new blog post.



To do the same for a service request you need to use a different relationship type. I haven´t created that mp yet but will create a blog for that also when I´m done with that.

New gallery upload: Remind Reviewers

March 6, 2012 Posted by Anders Asp

While working on a project for a customer of mine which involves a lot of approval steps, I realized that the whole process would be halted if someone forgets to cast their vote on a review activity. In order to prevent this from happening I created a powershell script to remind the reviewers who hasn’t voted for a certain period of time that we are awaiting their approval.

There’s a couple of parameters to configure in the script, but otherwise it’s ready to use. This is how the reminder e-mail might look:

Read more and download the script at the TechNet gallery: