Skip to content

March 10, 2011

21

SCSM: Notification workflow on Work Item assignments

Update: I have written an additional blog entry on this topic to address both Service Requests and Release Records.  This post can be found here: Notification workflow on Work Item assignments (Part 2)

The Microsoft Service Manager team has written two great blogs on how to create the workflows required in Service Manager to send out notifications when a work item has been assigned/re-assigned.  Initially you might think this could be done in the UI, but actually it must be done in XML.  The Service Manager team has provided great examples on how to do this for both Incidents and Activities.

The blog for Incidents can be found here: http://blogs.technet.com/b/servicemanager/archive/2009/12/15/custom-notification-workflow-on-incident-assignement-or-re-assignment.aspx?PageIndex=2.

The blog for Activities can be found here: http://blogs.technet.com/b/servicemanager/archive/2010/03/12/custom-notification-workflow-on-activity-assignment-or-reassignment.aspx.

I followed the blogs above and got it working in no time for both my Incidents and Activities.  However, I also wanted to do this for my Problems and Change Requests.  Both of these can be accomplished by swapping out various pieces in the XML (ie. replace WorkItem.Activity with WorkItem.ChangeRequest in the XML, changing the Management Pack references, and a few other items).  I found I had to be careful when doing my find/replace as I had to make sure I got all the references right (ie. the WriteAction for my Problem Workflow uses the Incident Assembly (Microsoft.EnterpriseManagement.ServiceManager.Incident.Workflows)).

I also wanted to use Notification Templates I had already created in the GUI, so I used a GUID for my Notification Templates in the XML.  As documented in the first blog above, you simply modify the following tag:

<WorkflowArrayParameter Name=”NotificationTemplatesType=”guid“>
<Item>50dc32c2-6517-e9ea-dd99-0455383cab17</Item>
</WorkflowArrayParameter>

You can run the following query on your cmdb to find your GUID:

SELECT TOP 1000 [ObjectTemplateId]
,[ManagementPackId]
,[ObjectTemplateName]
,[Accessibility]
,[ObjectTemplateTypeId]
,[ObjectTemplateSubelementXML]
,[TimeAdded]
,[LastModified]
FROM [ServiceManager].[dbo].[ObjectTemplate]

Finally, for my Incidents, I wanted my Affected User to get a seperate notificate (using a different template) in addition to the Assigned to user.  This is actually simple to do.  We just need to add two additional <Item> tags.  The first one is an addition <Item>GUID</Item> under the  <WorkflowArrayParameter Name=”NotificationTemplates” Type=”guid”> tag, this is for the second template.  The other is an additional <Item> tag under the <WorkflowArrayParameter Name=”UserAliasOrRelationshipsType=”string> for the relationship.  In my case, to send to the affected user, the tag is like this: <Item>16FBB858-634F-1732-9D44-92F161F10706</Item>.

If you don’t want to worry about having to mess with a lot of XML, I have included at the bottom of this post, working examples of these Management Packs to create the notifications for all types of Work Items.  Only my Incident Management Pack contains two notifications.  To make these Management Packs work in your environment, all you will need to edit is the GUID in the <Item> tag for the Notification Templates, example below:

<WorkflowArrayParameter Name=”NotificationTemplatesType=”guid“>
<Item>Change this GUID</Item>
</WorkflowArrayParameter>

You can also simply use these Management Packs as a guide to modifying your own.  Once you are done making changes, simply import the management packs and the workflows will begin processing.

AssignmentChanges.Notification.ManagementPacks.zip

21 Comments Post a comment
  1. Dave
    Mar 12 2011

    Actually yes your right in your first paragraph, you would think that this would be done in the GUI. I like SCSM, but it really feels like a unfinished product. Hell the Exchange Connector is an unofficial bolt on…

    Let’s hope the next version is more complete

    Reply
  2. Brent
    Mar 14 2011

    Dave, I do agree with you. There are several apsects of the product that really do lack some (I guess that comes with the territory of being a v1 product). However, as a whole I think its going to be a really solid product, just got some growing to do. From what I have heard, the R2 release at the end of this year is hopefully going to tie up a lot of the quirky things.

    Reply
  3. Slaven
    Mar 31 2011

    I am totally new with this product and trying to do proof of concept. I am not a coder and I thought some more basic staff will be available from the box. Maybe they are somewhere there, but I do not know how to find them.  I just want that affected user can receive email when the incident is created for him. Now I can see end user notification template but I have no clue what else I need to do. I setup the notification channel and I follow those 2 links. It works good. At lease assigned agent gets email notification.
    I saw you explained this, but I need something more for dummies who never worked with xml.  Is there are any document that explains step by step “how to notify an affected user when the incident is created? If you may do some snapshots it would be great.

    Reply
  4. Brent
    Mar 31 2011

    Slaven, I find most things I need notifications for are doable using out of the box wizards. The main one you can’t is the one this blog post is about. I don’t have a document or link for what you are wanting to do, but it isn’t terribly difficult. You will need to use a workflow (not just a notification subscription). Basically use Notification Subscriptions for fixed recipients and use Workflows for variable users (ie. send to Affected User, etc.). To create the workflow follow these steps:

    1. Open Administration, expand Workflows, click Configuration
    2. Select properties for “Incident Event Workflow Configuration”
    3. Click Add to create a new workflow, click Next
    4. Give the workflow a name, such as “Notify Affected User Ticket Created”
    5. Set to check for events: When an incident is created
    6. Store in a MP, such as a custom one or the Incident Management Configuration Library
    7. Ensure enabled is selected, click Next
    8. Next specify the criteria you want to use, for example I selected “If Incident Source equals Console or Phone” but you can setup whatever fits your needs here. Click Next
    9. On the next page, unless you need to apply a template, select Do not apply template and click Next
    10. On the final page, ensure Enable Notification is selected, select the User “Affected User” and select the template you want to use to send the mail and click Add (make sure to click Add, this is easy to miss and will not work unless it is clicked). Click Finish.

    That should be all you need to do and as you can see there are many useful notifications that can be setup from this area, I have a lot. Setting up notifications in SCSM can be very time consuming, but once they are there they are there and overall they can be pretty powerful (just need some quicky things fixed).

    From what I have read, I think a lot of the quicky things that you can’t do in the UI today will be fixed in the 2012 version coming out at the end of the year, I am looking forward to when the beta will come out and can see. I know there are suppose to be improvements for notifications.

    Does this answer your question?

    Reply
  5. Slaven
    Mar 31 2011

    Brent,
    Thank you so much. It works. 🙂

    Slaven

    Reply
    • Brent
      Mar 31 2011

      Great! Glad to hear 🙂

      Reply
  6. William
    May 12 2011

    Does anyone know how to add a specific individual to be notified when an Incident is assigned to an analyst. For example, if my boss wants to be notified whenever a ticket is assigned to an analyst, how do I find the UserAliasOrRelationships String needed in that “Notification workflow on Work Item assignments MP”, that will allow email to be sent to “boss”. whenever an analyst gets assigned the ticket.
    thanks

    Reply
    • Brent
      May 13 2011

      William,

      You should just be able to use the GUID of the username you want to send the notification to. Travis over on the system center blogs has written a great blog about how to find the GUID. It can be found here: http://blogs.technet.com/b/servicemanager/archive/2011/05/12/using-smlets-beta-3-post-5-getting-the-guid-id-of-an-object.aspx

      The nutshell of it is: you will likely need to change “UserAliasOrRelationships” to “PrimaryUserList”. Then use SMLets from CodePlex (http://smlets.codeplex.com/) to find the GUID by running this powershell command:

      Get-SCSMObject –Class (Get-SCSMClass –Name System.Domain.User) –Filter “UserName -eq %userhere%” | Format-Table ID, DisplayName

      You should be able to use groups here as well.

      Hope this answers your question.

      Reply
      • William
        May 13 2011

        Thanks for the response Brent!

        I actually did all that, including checking the SMlets to get the GUID, etc. I have done a whole variety of scenarios to get both the UserAliasOrRelationships GUIDs and the PrimaryUserList GUIDS to work, including your recommendations.

        Unfortunately they’ve all failed to recognize that individual/team GUID through this MP. Besides the scenario you recommended, I’ve also tried tcopying the WriteActions section and then adjusting the second Write Action section to use PrimaryUserList, etc.

        All in all, I think I’ve come to the conclusion that adding individual user/group GUIDS won’t work with this MP.
        The key error I see, is that the AutomaticIncidentChangeWorkflow has no public writeable property named ‘PrimaryUserList’.

        Anyways, thanks for the response. If somehow you manage to get this working on your version of the MP, I would love to see how you did it.

        Thanks again.
        William

        Reply
        • William
          May 13 2011

          Brent, Last attempt worked. If interested, here is what mine looks: like:

          true

          Microsoft.EnterpriseManagement.ServiceManager.Incident.Workflows
          Microsoft.EnterpriseManagement.ServiceManager.Incident.Workflows.AutomaticIncidentChangeWorkflow

          $Data/BaseManagedEntityId$

          True

          7890E174-81C4-0B99-9994-4C7645BDAA73
          7890E174-81C4-0B99-9994-4C7645BDAA73

          15e211a3-6bf9-9056-4vcx-ba5a5b7c4722
          gaa9be21-38b0-b6d6-6122-a412a3abj4ce

          60
          1500

          true

          Microsoft.EnterpriseManagement.Notifications.Workflows
          Microsoft.EnterpriseManagement.Notifications.Workflows.SendNotificationsActivity

          $Data/.$

          $Data/BaseManagedEntityId$

          b43ew39e-7456-d7a7-4efe-704edcecce11

          D67E941F-10E2-114B-1FEA-2F708188BFB2

          60
          1500

          Reply
          • Brent
            May 16 2011

            William, great, glad you got it working! Thanks for posting your results.

    • Dave
      Nov 16 2011

      Maybe this is a little late, but I use the Subscriptions to notify individuals (like the boss) when certain criteria are set (like escalate). Its also used for area directors who want to be apprised of all the workings in their area.

      Reply
  7. Dave
    Feb 13 2012

    Just as follow up to my first post almost 12 months ago, this is still missing from the 2012 release, (confimed by the MS product manager).

    They hope to include in future releases…..hmmm

    Even this next version is begining to feel like an unfinished product.

    Reply
    • Brent
      Feb 13 2012

      Dave, thanks for the the follow-up information. That is unfortunate to hear, was hoping that 2012 release would solve.

      Reply
  8. Marco
    Jul 26 2012

    Hi Brent,

    This MP has helped me a bit. The thing is that I want to combine the status and assignment in the notification of activities. The notification must be send when the status of activity turns from Pending to in Progress and the assigned to user is nnot empty. Or when the status is in Progress and the assignee name is changing. For he last part I used your MP, that is when the assignee name is changing. But Then I receive at least two notification for each activitie that is on my name. First when it is assigned to me when pending, and second when the activity is becoming active i.e when the status turns to in Progress. How to combine it whit your MP? I tried to figure that out, but tweaking a MP is quite complicated.

    Reply
    • Brent
      Jul 26 2012

      Marco, if I understand what you are trying to do correctly, unfortunately it is not possible to accomplish this currently with the product (hopefully that will change in future versions). You cannot combine both relationship subscriptions with regular conditional subscriptions. Notifications based on fields pertaining to people, such as Assigned to or Affected User can only be accessed using a Relationship Subscription. A notification for when a ticket changes from pending to in progress is a regular conditional subscription, this is the kind that can be configured in the GUI. Unfortunately, you cannot combine both these types in the same notification. I wish you could, as I would like to do something similar, but unfortunately it isn’t possible today.

      Reply
  9. Mohamed
    Feb 25 2013

    Did you try this for Review Activity ? I have been trying without sucess

    Reply

Trackbacks & Pingbacks

  1. Service Requests – Re-assignment notification | Fletcher's space
  2. SCSM: Notification workflow on Work Item assignments (Part 2) | bcTechNet
  3. How do I “learn” System Center Service Manager 2012? | Fletcher's space
  4. How do I “learn” System Center Service Manager 2012? « System Center Guy ZA

Share your thoughts, post a comment.

(required)
(required)

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments