locked
Notification only if Resolved by user is not Assigned to user RRS feed

  • Question

  • Basically, I would like to not see notifications when I close my own tickets.  If another analyst resolves/closes my ticket i want a notification.

    So the criteria should be something like:

    Changed To: [Status] <Equals> Closed

    And [Resolved By User] <Does Not Equal> Assigned To User

    or maybe...

    Changed To: [Status] <Equals> Closed

    And [Resolved By User] <Does Not Equal> Me

    But i cat seem to enter this through the console.  Any help?


    - Get on the floor, do that dinosaur

    Thursday, June 27, 2013 1:56 PM

Answers

  • The subscription engine can't compare values from two different relationships, but, I do have a workflow assembly that can be copied to the workflow server to handle this. You just need to export your Management Pack that defines your workflow and add a new workflow array parameter of "UserAliasOrRelationshipsToSkip", plus change the assembly name and type like this:

    <WriteActions>
      <WriteAction ID="WA" TypeID="SystemCenter!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction">
        <Subscription>
          <VisibleWorkflowStatusUi>true</VisibleWorkflowStatusUi>
          <EnableBatchProcessing>true</EnableBatchProcessing>
          <WindowsWorkflowConfiguration>
            <AssemblyName>SCSMNZ.NET.Workflows</AssemblyName>
            <WorkflowTypeName>SCSMNZ.NET.Workflows.WorkItemNotification</WorkflowTypeName>
            <WorkflowParameters>
              <WorkflowArrayParameter Name="InstanceIds" Type="guid">
                <Item>$Data/BaseManagedEntityId$</Item>
              </WorkflowArrayParameter>
              <WorkflowParameter Name="InstanceTemplate" Type="guid">f9a5041d-1785-729d-3535-238022ad744d</WorkflowParameter>
              <WorkflowParameter Name="NotificationRulesEnabled" Type="boolean">True</WorkflowParameter>
              <WorkflowArrayParameter Name="NotificationTemplates" Type="guid">
                <Item>2a52fd91-c6e2-a23d-f4a1-f78876c4584f</Item>
              </WorkflowArrayParameter>
              <WorkflowArrayParameter Name="UserAliasOrRelationships" Type="string">
                <Item>15e577a3-6bf9-6713-4eac-ba5a5b7c4722</Item>
              </WorkflowArrayParameter>
              <WorkflowArrayParameter Name="UserAliasOrRelationshipsToSkip" Type="string">
                <Item>f7d9b385-a84d-3884-7cde-e2c926d931a5</Item>
              </WorkflowArrayParameter>
            </WorkflowParameters>
            <RetryExceptions />
            <RetryDelaySeconds>60</RetryDelaySeconds>
            <MaximumRunningTimeSeconds>7200</MaximumRunningTimeSeconds>
          </WindowsWorkflowConfiguration>
        </Subscription>
      </WriteAction>
    </WriteActions>

    If the target user for relationship UserAliasOrRelationships is the same as that for UserAliasOrRelationshipsToSkip, no notification will be sent.

    Let me know if this is of interest to you. You cannot edit the workflow in the GUI after this. Well, you can, but you'll need to add the extra parameter in and change the assembly details again.


    Rob Ford scsmnz.net
    Cireson www.cireson.com
    For a free SCSM 2012 Notify Analyst app click here


    • Edited by Rob.Ford Monday, July 1, 2013 11:45 PM More info
    • Marked as answer by Pete Barbuto Wednesday, July 3, 2013 6:47 PM
    Monday, July 1, 2013 11:43 PM

All replies

  • Hi,

    For me the solution is to add this condition :

    And [Resolved By User] <Does Not Equal> [Assigned to]

    but in subscrition or workflow only one Relationship is allow ...

    Good luck


    Best Regards Remy BOVI

    Thursday, June 27, 2013 4:13 PM
  • Im not actually able to add it though.  The subscription is based on the work item being updated e.g. closed.  Under criteria > Changed to I can only add resolved by users attributes like their user name.  So it actually looks like:

    And [Resolved By User] User Name <Does Not Equal> [Assigned to]

    Which didnt work. 


    - Get on the floor, do that dinosaur

    Thursday, June 27, 2013 8:29 PM
  • The subscription engine can't compare values from two different relationships, but, I do have a workflow assembly that can be copied to the workflow server to handle this. You just need to export your Management Pack that defines your workflow and add a new workflow array parameter of "UserAliasOrRelationshipsToSkip", plus change the assembly name and type like this:

    <WriteActions>
      <WriteAction ID="WA" TypeID="SystemCenter!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction">
        <Subscription>
          <VisibleWorkflowStatusUi>true</VisibleWorkflowStatusUi>
          <EnableBatchProcessing>true</EnableBatchProcessing>
          <WindowsWorkflowConfiguration>
            <AssemblyName>SCSMNZ.NET.Workflows</AssemblyName>
            <WorkflowTypeName>SCSMNZ.NET.Workflows.WorkItemNotification</WorkflowTypeName>
            <WorkflowParameters>
              <WorkflowArrayParameter Name="InstanceIds" Type="guid">
                <Item>$Data/BaseManagedEntityId$</Item>
              </WorkflowArrayParameter>
              <WorkflowParameter Name="InstanceTemplate" Type="guid">f9a5041d-1785-729d-3535-238022ad744d</WorkflowParameter>
              <WorkflowParameter Name="NotificationRulesEnabled" Type="boolean">True</WorkflowParameter>
              <WorkflowArrayParameter Name="NotificationTemplates" Type="guid">
                <Item>2a52fd91-c6e2-a23d-f4a1-f78876c4584f</Item>
              </WorkflowArrayParameter>
              <WorkflowArrayParameter Name="UserAliasOrRelationships" Type="string">
                <Item>15e577a3-6bf9-6713-4eac-ba5a5b7c4722</Item>
              </WorkflowArrayParameter>
              <WorkflowArrayParameter Name="UserAliasOrRelationshipsToSkip" Type="string">
                <Item>f7d9b385-a84d-3884-7cde-e2c926d931a5</Item>
              </WorkflowArrayParameter>
            </WorkflowParameters>
            <RetryExceptions />
            <RetryDelaySeconds>60</RetryDelaySeconds>
            <MaximumRunningTimeSeconds>7200</MaximumRunningTimeSeconds>
          </WindowsWorkflowConfiguration>
        </Subscription>
      </WriteAction>
    </WriteActions>

    If the target user for relationship UserAliasOrRelationships is the same as that for UserAliasOrRelationshipsToSkip, no notification will be sent.

    Let me know if this is of interest to you. You cannot edit the workflow in the GUI after this. Well, you can, but you'll need to add the extra parameter in and change the assembly details again.


    Rob Ford scsmnz.net
    Cireson www.cireson.com
    For a free SCSM 2012 Notify Analyst app click here


    • Edited by Rob.Ford Monday, July 1, 2013 11:45 PM More info
    • Marked as answer by Pete Barbuto Wednesday, July 3, 2013 6:47 PM
    Monday, July 1, 2013 11:43 PM
  • Thanks Rob! This looks like what I need.  Mine currently looks like:

    <WriteActions>
              <WriteAction ID="WA" TypeID="SystemCenter1!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction">
                <Subscription>
                  <VisibleWorkflowStatusUi>true</VisibleWorkflowStatusUi>
                  <EnableBatchProcessing>true</EnableBatchProcessing>
                  <WindowsWorkflowConfiguration>
                    <AssemblyName>Microsoft.EnterpriseManagement.Notifications.Workflows</AssemblyName>
                    <WorkflowTypeName>Microsoft.EnterpriseManagement.Notifications.Workflows.SendNotificationsActivity</WorkflowTypeName>
                    <WorkflowParameters>
                      <WorkflowParameter Name="SubscriptionId" Type="guid">$MPElement$</WorkflowParameter>
                      <WorkflowArrayParameter Name="DataItems" Type="string">
                        <Item>$Data/.$</Item>
                      </WorkflowArrayParameter>
                      <WorkflowArrayParameter Name="InstanceIds" Type="string">
                        <Item>$Data/BaseManagedEntityId$</Item>
                      </WorkflowArrayParameter>
                      <WorkflowArrayParameter Name="TemplateIds" Type="string">
                        <Item>b0bb7b54-e7b6-3089-dc1c-b3b30fd68978</Item>
                      </WorkflowArrayParameter>
                      <WorkflowArrayParameter Name="PrimaryUserRelationships" Type="string">
                        <Item>$Context/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemAffectedUser' TypeConstraint='CustomSystem_Library!System.User']$</Item>
                      </WorkflowArrayParameter>
                    </WorkflowParameters>
                    <RetryExceptions />
                    <RetryDelaySeconds>60</RetryDelaySeconds>
                    <MaximumRunningTimeSeconds>7200</MaximumRunningTimeSeconds>
                  </WindowsWorkflowConfiguration>
                </Subscription>
              </WriteAction>
            </WriteActions>

    Since mine has PrimaryUserRelationShips instead of UserAliasOrRelationShips, should I change that?  Otherwise it looks like i can just add the WorkflowArrayParameter - UserAliasOrRelationShipsToSkip.

    Also, is the guid under the UserAliasOrRelationShipsToSkip the relationship or variable [me]?


    - Get on the floor, do that dinosaur

    Tuesday, July 2, 2013 1:41 PM
  • That's a subscription workflow, my assembly is designed to be used for workflows created via Administration\Workflows\Configuration. [Me] won't work in workflow criteria, it only works in view criteria, or actually, criteria used in the console context of the current user.

    Rob Ford scsmnz.net
    Cireson www.cireson.com
    For a free SCSM 2012 Notify Analyst app click here

    Tuesday, July 2, 2013 9:21 PM
  • Hey

    Another option for more complex criterias is to use Orchestrator as your notification engine. I used it lately for a customer that wanted something like this:

    "If an End User or Analyst comment is added to an Incident, the Assigned to User should get an eMail. However, when the Incident is NOT assigned to a specific user, the Support Group (members) should get an email."

    This can also be done using custom workflows in SCSM, but from a customer perspective it's harder to maintain the process ... at least that's what I think :)

    Cheers
    Marcel


    Marcel Zehner // Blog --> http://marcelzehner.ch // Twitter --> @marcelzehner // Business --> http://www.itnetx.ch

    Wednesday, July 3, 2013 9:09 AM
  • Marcel, I know but we wont have SCO until later in the year and the techs are currently getting so much spam from SCSM that they aren't even looking at it.  I cant say i blame them either.  

    Rob, thanks for the clarification.  I believe I have it working now.  Thanks!


    - Get on the floor, do that dinosaur


    • Edited by Pete Barbuto Wednesday, July 3, 2013 6:47 PM I'm a dum dum.
    Wednesday, July 3, 2013 6:09 PM
  • Rob, 

    Would you please send me the file so that I could implement your suggestion?  My email is pbarbuto@oakwoodsys.com

    Thanks,

    Pete Barbuto


    - Get on the floor, do that dinosaur


    • Edited by Pete Barbuto Friday, July 12, 2013 1:59 PM removed email
    Monday, July 8, 2013 3:10 PM
  • Sorry for the delay, it can be downloaded from here:

    http://scsmnz.net/Tools/SCSMNZ.NET.Workflows.zip

    Remember this assembly is not for subscription workflows but those created via Administration\Workflows\Configuration.

    If the workflow fails with "assembly does not allow partially trusted callers" you will need to download streams.exe from:

    http://technet.microsoft.com/en-us/sysinternals/bb897440.aspx

    And then run:

    streams -d SCSMNZ.NET.Workflows.dll


    Rob Ford scsmnz.net
    Cireson www.cireson.com
    For a free SCSM 2012 Notify Analyst app click here

    Friday, July 12, 2013 5:45 AM
  • Works great Rob, Thanks!  You wouldn't happen to have a similar assembly for Service Requests, would you? 

    - Get on the floor, do that dinosaur

    Friday, July 12, 2013 1:58 PM
  • I haven't tested it, but the DLL should work for any workflow of this type on a work item, it is not incident specific

    Rob Ford scsmnz.net
    Cireson www.cireson.com
    For a free SCSM 2012 Notify Analyst app click here

    Sunday, July 14, 2013 9:00 PM
  • Should I be making a management pack bundle with the assembly?  Or adding a resource bit at the end like:

    <Resources>
       <Assembly ID="SCSMNZ.NET.Workflows" Accessibility="Public" QualifiedName="SCSMNZ.NET.Workflows" FileName="SCSMNZ.NET.Workflows.dll" />
    </Resources>


    - Get on the floor, do that dinosaur

    Monday, July 15, 2013 3:47 PM