Notifying the Affected User When the Analyst Has Updated the Action Log

Update:  All the discussion on this post led me to create a much better solution called Send Email that ships with the Exchange connector.  I HIGHLY recommend checking that out as a better alternative to this.

http://blogs.technet.com/b/servicemanager/archive/2011/01/07/exchange-connector-released.aspx

==================

  • Awhile back I made a post about how you can send notifications to the Affected User when the analyst clicks on the Request Input from User task.  Another common thing that people ask how to do is to send notifications to the affected user whenever the analyst updates the action log just so the affected user is kept in the loop.  That requires creating a relationship subscription which as we have shown in a previous post is only possible to create directly in XML.

    In the MP XML below I’ve created a notification subscription that will send a notification to the affected user whenever the action log has an analyst comment added to it.

<ManagementPack ContentReadable=true SchemaVersion=1.1 OriginalSchemaVersion=1.1 xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:xsl=http://www.w3.org/1999/XSL/Transform>

<Manifest>

<Identity>

<ID>ActionLogAddRelationshipSubscription</ID>

<Version>1.0.0.0</Version>

</Identity>

<Name>Action Log Add Relationship Subscription</Name>

<References>

<Reference Alias=Console>

<ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>

<Version>7.0.5826.859</Version>

<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

</Reference>

<Reference Alias=NotificationsLibrary>

<ID>System.Notifications.Library</ID>

<Version>7.0.5826.0</Version>

<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

</Reference>

<Reference Alias=WorkItem>

<ID>System.WorkItem.Library</ID>

<Version>7.0.5826.0</Version>

<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

</Reference>

<Reference Alias=ServiceManager.IncidentLibrary>

<ID>ServiceManager.IncidentManagement.Library</ID>

<Version>7.0.5826.0</Version>

<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

</Reference>

<Reference Alias=System>

<ID>System.Library</ID>

<Version>7.0.5826.0</Version>

<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

</Reference>

<Reference Alias=IncidentLibrary>

<ID>System.WorkItem.Incident.Library</ID>

<Version>7.0.5826.0</Version>

<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

</Reference>

<Reference Alias=Subscriptions>

<ID>Microsoft.SystemCenter.Subscriptions</ID>

<Version>7.0.5826.0</Version>

<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

</Reference>

<Reference Alias=Administration>

<ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Administration</ID>

<Version>7.0.5826.859</Version>

<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

</Reference>

</References>

</Manifest>

<Categories>

<Category ID=Category.ActionLogAddRelationshipSubscriptions.ManagementPack Value=Console!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack>

<ManagementPackName>ActionLogAddRelationshipSubscription</ManagementPackName>

<ManagementPackVersion>7.0.5826.0</ManagementPackVersion>

</Category>

<Category ID=Category.ActionLogAddRelationshipSubscriptionRule Target=ActionLogAddRelationshipSubscriptionRule Value=Administration!Microsoft.EnterpriseManagement.ServiceManager.Rules.WorkflowSubscriptions />

<Category ID=ActionLogAddRelationshipAffectedUserNotificationTemplate.Category Target=ActionLogAddRelationshipAffectedUserNotificationTemplate Value=Administration!ServiceManager.Console.NotificationManagement.NotificationTemplates.Enumeration />

</Categories>

<Monitoring>

<Rules>

<Rule ID=ActionLogAddRelationshipSubscriptionRule Enabled=true Target=ServiceManager.IncidentLibrary!System.WorkItem.Incident.WorkflowTarget ConfirmDelivery=true Remotable=true Priority=Normal DiscardLevel=100>

<Category>System</Category>

<DataSources>

<DataSource ID=DS TypeID=Subscriptions!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule>

<Subscription>

<RelationshipSubscription RelType=$MPElement[Name=’WorkItem!System.WorkItem.TroubleTicketHasAnalystComment‘]$ SourceType=$MPElement[Name=’WorkItem!System.WorkItem.TroubleTicket‘]$ TargetType=$MPElement[Name=’WorkItem!System.WorkItem.TroubleTicket.AnalystCommentLog‘]$>

<AddRelationship />

</RelationshipSubscription>

<PollingIntervalInSeconds>30</PollingIntervalInSeconds>

<BatchSize>100</BatchSize>

</Subscription>

</DataSource>

</DataSources>

<WriteActions>

<WriteAction ID=WA TypeID=Subscriptions!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction>

<Subscription>

<EnableBatchProcessing>false</EnableBatchProcessing>

<WindowsWorkflowConfiguration>

<AssemblyName>Microsoft.EnterpriseManagement.WorkflowFoundation</AssemblyName>

<WorkflowTypeName>Microsoft.EnterpriseManagement.WorkflowFoundation.ConfigurationWorkflow</WorkflowTypeName>

<WorkflowParameters>

<WorkflowParameter Name=InstanceId Type=guid>$Data/BaseManagedEntityId$</WorkflowParameter>

<WorkflowArrayParameter Name=UserRelationshipIdList Type=guid>

<Item>$MPElement[Name=’WorkItem!System.WorkItemAffectedUser‘]$</Item>

</WorkflowArrayParameter>

<WorkflowArrayParameter Name=NotificationTemplateIdList Type=guid>

<Item>$MPElement[Name=’ActionLogAddRelationshipAffectedUserNotificationTemplate‘]$</Item>

</WorkflowArrayParameter>

</WorkflowParameters>

<RetryExceptions />

<RetryDelaySeconds>60</RetryDelaySeconds>

<MaximumRunningTimeSeconds>7200</MaximumRunningTimeSeconds>

</WindowsWorkflowConfiguration>

</Subscription>