Workflow doesn't trigger on change of AssignedToUser

Stephane_BouillonStephane_Bouillon Customer Adept IT Monkey ✭✭
Hi,


I want to run a workflow whenever the AssignedToUser is updated on an incident, and is set to a specific user. I isolated this workflow in its own management pack so I could craft the condition as below. However, when I update the assigned to user, my workflow isn't triggered. Am I doing it wrong ? Or is this a bug or by design ?

      <Rule ID="WorkflowSubscription_beda1dfa_06b2_41ea_a5a2_543411650eac" Enabled="true" Target="Connectors!System.WorkItem.SMARunbookActivity.WorkflowTarget" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
        <Category>System</Category>
        <DataSources>
          <DataSource ID="DS" TypeID="SystemCenter!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule">
            <Subscription>
              <InstanceSubscription Type="a604b942-4c7b-2fb2-28dc-61dc6f465c68">
                <UpdateInstance>
                  <Criteria>
                    <Expression>
                      <And>
                        <Expression>
                          <SimpleExpression>
                            <ValueExpression>
                              <Property State="Pre">$Context/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemAssignedToUser' TypeConstraint='CustomSystem_Library!System.Domain.User']/Property[Type='CustomSystem_Library!System.Domain.User']/UserName$</Property>
                            </ValueExpression>
                            <Operator>NotEqual</Operator>
                            <ValueExpression>
                              <Property State="Post">$Context/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemAssignedToUser' TypeConstraint='CustomSystem_Library!System.Domain.User']/Property[Type='CustomSystem_Library!System.Domain.User']/UserName$</Property>
                            </ValueExpression>
                          </SimpleExpression>
                        </Expression>
                        <Expression>
                          <SimpleExpression>
                            <ValueExpression>
                              <Property State="Post">$Context/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemAssignedToUser' TypeConstraint='CustomSystem_Library!System.Domain.User']/Property[Type='CustomSystem_Library!System.Domain.User']/UserName$</Property>
                            </ValueExpression>
                            <Operator>Equal</Operator>
                            <ValueExpression>
                              <Value>Sabco</Value>
                            </ValueExpression>
                          </SimpleExpression>
                        </Expression>
                      </And>
                    </Expression>
                  </Criteria>
                </UpdateInstance>
              </InstanceSubscription>
              <PollingIntervalInSeconds>100</PollingIntervalInSeconds>
              <BatchSize>50</BatchSize>
            </Subscription>
          </DataSource>
        </DataSources>
        <WriteActions>
          <WriteAction ID="WA" TypeID="SystemCenter!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction">
            <Subscription>
              <VisibleWorkflowStatusUi>true</VisibleWorkflowStatusUi>
              <EnableBatchProcessing>true</EnableBatchProcessing>
              <WindowsWorkflowConfiguration>
                <AssemblyName>Microsoft.EnterpriseManagement.ServiceManager.SMA.Workflows</AssemblyName>
                <WorkflowTypeName>Microsoft.EnterpriseManagement.ServiceManager.SMA.Workflows.ProcessWorkItem</WorkflowTypeName>
                <WorkflowParameters>
                  <WorkflowArrayParameter Name="InstanceIds" Type="guid">
                    <Item>$Data/BaseManagedEntityId$</Item>
                  </WorkflowArrayParameter>
                  <WorkflowParameter Name="NotificationRulesEnabled" Type="boolean">False</WorkflowParameter>
                  <WorkflowParameter Name="ParametersId" Type="guid">37a3b1e2-57b5-805a-a15e-60be136a3c21</WorkflowParameter>
                </WorkflowParameters>
                <RetryExceptions />
                <RetryDelaySeconds>60</RetryDelaySeconds>
                <MaximumRunningTimeSeconds>7200</MaximumRunningTimeSeconds>
              </WindowsWorkflowConfiguration>
            </Subscription>
          </WriteAction>
        </WriteActions>
      </Rule>

Answers

  • Stephane_BouillonStephane_Bouillon Customer Adept IT Monkey ✭✭
    Is it because AssignedToUser is not part of the Pre conditions (why is that by the way) ?
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    edited July 2018
    2 edits later... I keep noticing things after I click Save...

    This line tells me that the notification portion your workflow is disabled, so there is no mail (if that was even a concern):
    <WorkflowParameter Name="NotificationRulesEnabled" Type="boolean">False</WorkflowParameter>

    I would check the event logs to see if there are any failures connecting to SMA.  Perhaps the password is unavailable or incorrect in the connector...?
  • Stephane_BouillonStephane_Bouillon Customer Adept IT Monkey ✭✭
    I'm certain of the password, because I have to enter it when configuring the workflow.
  • Stephane_BouillonStephane_Bouillon Customer Adept IT Monkey ✭✭
    Btw, the same workflow is triggered on create of a new incident (AddInstance) when the AssignedToUser is "Sabco", and that one works as expected. It is only the UpdateInstance that doesn't trigger. With the "Pre" and "Post" approach, the workflow should at least trigger everytime the assigned user changes to Sabco right ?
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    So I take it there are no errors in the event log?  Do you see any failed workflows in SCSM for this, or are there no update workflows triggering for these incidents?
  • Stephane_BouillonStephane_Bouillon Customer Adept IT Monkey ✭✭
    no failed workflows in the console Under workflow status
  • Stephane_BouillonStephane_Bouillon Customer Adept IT Monkey ✭✭
    Can anybody confirm that this should work ? Has anybody done something like this already ?
Sign In or Register to comment.