locked
Incident Assigned - Workflow - SCSM 2012 RRS feed

  • Question

  • Hi,

    I have recently implemented SCSM 2012 at our organisation and am implementing workflows for notifications.

    I have created an "Incident Assigned to Analyst" workflow that will send a notification to the user and Analyst in question but am receiving a notification every single time the incident is updated with anything.

    The logical fix would be to specificy the event criteria as follows:

    Changed from
    Incident, assigned to user is empty

    Chanted to
    Incident, assigned to user is not empty

    ... but the changed from class doesn't allow me to select the "assigned to user" property group.
    ... ... and on top of this, this also obviously won't trigger when an incident has changed hands.

    I'm clearly going about this the complete wrong way - could you kindly advise if there is another way I direction I should be headed to achieve this goal?

    Any advice is much appreciated.

    Thanks in advance!

    Monday, June 11, 2012 9:27 AM

Answers

  • You need to use a relationship subscription like this:

     <Rule ID="IncidentAssignmentChanges" Enabled="true" Target="SystemCenter!Microsoft.SystemCenter.SubscriptionWorkflowTarget" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
            <Category>Discovery</Category>
            <DataSources>
              <DataSource ID="DS" TypeID="SystemCenter1!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule">
                <Subscription>
                  <RelationshipSubscription RelType="$MPElement[Name='WorkItem!System.WorkItemAssignedToUser']$" SourceType="$MPElement[Name='CoreIncident!System.WorkItem.Incident']$" TargetType="$MPElement[Name='System!System.Domain.User']$">
                    <AddRelationship />
                  </RelationshipSubscription>
                  <PollingIntervalInSeconds>10</PollingIntervalInSeconds>
                  <BatchSize>100</BatchSize>
                </Subscription>
              </DataSource>
            </DataSources>
            <WriteActions>
              <WriteAction ID="WA" TypeID="SystemCenter1!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction">
                <Subscription>
                  <EnableBatchProcessing>true</EnableBatchProcessing>
                  <WindowsWorkflowConfiguration>
                    <AssemblyName>Microsoft.EnterpriseManagement.ServiceManager.Incident.Workflows</AssemblyName>
                    <WorkflowTypeName>Microsoft.EnterpriseManagement.ServiceManager.Incident.Workflows.AutomaticIncidentChangeWorkflow</WorkflowTypeName>
                    <WorkflowParameters>
                      <WorkflowArrayParameter Name="InstanceIds" Type="guid">
                        <Item>$Data/BaseManagedEntityId$</Item>
                      </WorkflowArrayParameter>
                      <WorkflowParameter Name="NotificationRulesEnabled" Type="boolean">True</WorkflowParameter>
                      <WorkflowArrayParameter Name="NotificationTemplates" Type="guid">
                        <Item>D53D4D1A-F924-E53D-780B-120E8C9C04B7</Item>
                      </WorkflowArrayParameter>
                      <WorkflowArrayParameter Name="UserAliasOrRelationships" Type="string">
                        <Item>15e577a3-6bf9-6713-4eac-ba5a5b7c4722</Item>
                      </WorkflowArrayParameter>
                    </WorkflowParameters>
                    <RetryExceptions />
                    <RetryDelaySeconds>60</RetryDelaySeconds>
                    <MaximumRunningTimeSeconds>1500</MaximumRunningTimeSeconds>
                  </WindowsWorkflowConfiguration>
                </Subscription>
              </WriteAction>
            </WriteActions>
          </Rule>

    Full details on the SCSM blog here:

    http://blogs.technet.com/b/servicemanager/archive/2009/12/15/custom-notification-workflow-on-incident-assignement-or-re-assignment.aspx


    Rob Ford scsmnz.net


    • Edited by Rob.Ford Monday, June 11, 2012 6:59 PM
    • Marked as answer by GC Leon Tuesday, June 12, 2012 9:15 AM
    Monday, June 11, 2012 6:59 PM

All replies

  • You need to use a relationship subscription like this:

     <Rule ID="IncidentAssignmentChanges" Enabled="true" Target="SystemCenter!Microsoft.SystemCenter.SubscriptionWorkflowTarget" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
            <Category>Discovery</Category>
            <DataSources>
              <DataSource ID="DS" TypeID="SystemCenter1!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule">
                <Subscription>
                  <RelationshipSubscription RelType="$MPElement[Name='WorkItem!System.WorkItemAssignedToUser']$" SourceType="$MPElement[Name='CoreIncident!System.WorkItem.Incident']$" TargetType="$MPElement[Name='System!System.Domain.User']$">
                    <AddRelationship />
                  </RelationshipSubscription>
                  <PollingIntervalInSeconds>10</PollingIntervalInSeconds>
                  <BatchSize>100</BatchSize>
                </Subscription>
              </DataSource>
            </DataSources>
            <WriteActions>
              <WriteAction ID="WA" TypeID="SystemCenter1!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction">
                <Subscription>
                  <EnableBatchProcessing>true</EnableBatchProcessing>
                  <WindowsWorkflowConfiguration>
                    <AssemblyName>Microsoft.EnterpriseManagement.ServiceManager.Incident.Workflows</AssemblyName>
                    <WorkflowTypeName>Microsoft.EnterpriseManagement.ServiceManager.Incident.Workflows.AutomaticIncidentChangeWorkflow</WorkflowTypeName>
                    <WorkflowParameters>
                      <WorkflowArrayParameter Name="InstanceIds" Type="guid">
                        <Item>$Data/BaseManagedEntityId$</Item>
                      </WorkflowArrayParameter>
                      <WorkflowParameter Name="NotificationRulesEnabled" Type="boolean">True</WorkflowParameter>
                      <WorkflowArrayParameter Name="NotificationTemplates" Type="guid">
                        <Item>D53D4D1A-F924-E53D-780B-120E8C9C04B7</Item>
                      </WorkflowArrayParameter>
                      <WorkflowArrayParameter Name="UserAliasOrRelationships" Type="string">
                        <Item>15e577a3-6bf9-6713-4eac-ba5a5b7c4722</Item>
                      </WorkflowArrayParameter>
                    </WorkflowParameters>
                    <RetryExceptions />
                    <RetryDelaySeconds>60</RetryDelaySeconds>
                    <MaximumRunningTimeSeconds>1500</MaximumRunningTimeSeconds>
                  </WindowsWorkflowConfiguration>
                </Subscription>
              </WriteAction>
            </WriteActions>
          </Rule>

    Full details on the SCSM blog here:

    http://blogs.technet.com/b/servicemanager/archive/2009/12/15/custom-notification-workflow-on-incident-assignement-or-re-assignment.aspx


    Rob Ford scsmnz.net


    • Edited by Rob.Ford Monday, June 11, 2012 6:59 PM
    • Marked as answer by GC Leon Tuesday, June 12, 2012 9:15 AM
    Monday, June 11, 2012 6:59 PM
  • Thanks Rob, I was hoping there was an out of the box solution for such simple service desk functionality but this MP did the trick.

    Thanks for your help!

    Tuesday, June 12, 2012 9:15 AM
  • Hi Rob,

    May I know if I can change the workflow to achieve scenario below ?

    Notification send to "Assigned to User" when the "Assigned to" field changes only if work item status is "Active"

    Thank you.

    Regards,
    Choo Hoong

    Tuesday, February 11, 2014 10:03 AM
  • Aries,

    This workflow fires only when the relationship is added. That's the only condition and you cannot check the incident's status. But you can create a custom workflow or use Orchestrator. 


    Cheers,
    Marat
    Site: www.scutils.com  Twitter:   LinkedIn:   Facebook:   

    Tuesday, February 11, 2014 11:29 AM