locked
Subscription based on queue membership RRS feed

  • Question

  • HI All

    Does anyone know of a way of constructing a subscription that generates an e-mail when a work item is simply added to a queue?

    This is because it's easier to construct a queue based on Scheduled Start date is =< [now=7d] than a subscription based on updates to the work item. All I need is an alert to tell users that a CR is due within the next 7 days.

    Using the 'when object meets criteria' SUBS method only fires once for each work item. So, if a SSD changes to within the next 7 days from a later date (i.e. it's brought forward) and the subscription has already checked that work item, it won't check again.

    The 'when an item is updated' SUBS method should work in conjunction with a queue that does the heavy lifting of SSD checking of work items.

    But the ability to discriminate between these dates in subscriptions is limited as there is no 'Relative to' check box and only with the ability to insert specific dates (which is no good for rolling release programs). Hence I can form a queue for the relationship, but no way of reliably triggering it.

    Hence the simplest need for criteria: 'if CR is simply added to the queue', can I generate an e-mail?

    Thanks

    Paul

    Teesside University

    UK

    Friday, March 4, 2016 10:12 AM

Answers

  • Yes you are right, the article is confusing the SCSM term queue with the meaning of "a queue".

    Technically this is possible, actually when you are making a queue, you are also making a new relationshipclass called: WorkItemGroup.<some guid>_Contains_<your target class>

    This is the reason why the console gives you a warning if you ever tried to import a management pack with queues.  Since this is an EntityType in which other configuration could point to, it's not legal unless the MP with the queue is sealed or that configuration with the queue-relationshipclass as source resides in the same management pack as the queue.

    Anyways .. what kind of subscription is needed here? Yes you guessed it: a relationship subscription. Just the same way as Assigned To user works.

    I have attached an example management pack here you can look at. It has a queue: Incident Priority 1, and a relationship subscription that triggers when a new Incident is added to this queue.

    Here's the important part:

    <RelationshipType ID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident" Accessibility="Public" Abstract="false" Base="CustomSystem_WorkItem_Library!System.WorkItemGroupContainsWorkItems">
              <Source ID="ContainedByGroup" MinCardinality="0" MaxCardinality="2147483647" Type="WorkItemGroup.dd742218956b41d481007bb0f9196b3f" />
              <Target ID="GroupContains" MinCardinality="0" MaxCardinality="2147483647" Type="CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident" />
            </RelationshipType>

    Here you need to replace: Relationship Type Id, Source and Target with the ones you need. I know this is a bit technical, but you can find some more readings on this here (Scenario 5)

    Full Management Pack (only for testing, don't import in prod env):

    <ManagementPack ContentReadable="true" SchemaVersion="2.0" OriginalSchemaVersion="1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <Manifest>
        <Identity>
          <ID>ManagementPack.ba7c31204b0547bc86b04d888ac59d63</ID>
          <Version>7.5.3079.0</Version>
        </Identity>
        <Name>Coretech - Notification - Incident Added to Queue</Name>
        <References>
          <Reference Alias="EnterpriseManagement">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
            <Version>7.5.3079.367</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_Notifications_Library">
            <ID>System.Notifications.Library</ID>
            <Version>7.5.3079.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_WorkItem_Library">
            <ID>System.WorkItem.Library</ID>
            <Version>7.5.3079.367</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_Library">
            <ID>System.Library</ID>
            <Version>7.5.8501.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="SystemCenter">
            <ID>Microsoft.SystemCenter.Library</ID>
            <Version>7.0.8433.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="SystemCenter1">
            <ID>Microsoft.SystemCenter.Subscriptions</ID>
            <Version>7.5.3079.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="EnterpriseManagement1">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Administration</ID>
            <Version>7.5.3079.367</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_WorkItem_Incident_Library">
            <ID>System.WorkItem.Incident.Library</ID>
            <Version>7.5.3079.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
        </References>
      </Manifest>
      <TypeDefinitions>
        <EntityTypes>
          <ClassTypes>
            <ClassType ID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f" Accessibility="Public" Abstract="false" Base="CustomSystem_WorkItem_Library!System.WorkItemGroup" Hosted="false" Singleton="true" Extension="false" />
          </ClassTypes>
          <RelationshipTypes>
            <RelationshipType ID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident" Accessibility="Public" Abstract="false" Base="CustomSystem_WorkItem_Library!System.WorkItemGroupContainsWorkItems">
              <Source ID="ContainedByGroup" MinCardinality="0" MaxCardinality="2147483647" Type="WorkItemGroup.dd742218956b41d481007bb0f9196b3f" />
              <Target ID="GroupContains" MinCardinality="0" MaxCardinality="2147483647" Type="CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident" />
            </RelationshipType>
          </RelationshipTypes>
        </EntityTypes>
      </TypeDefinitions>
      <Categories>
        <Category ID="Category.c39053258e4e4aa49983dd12ccaf6bf2" Value="EnterpriseManagement!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
          <ManagementPackName>ManagementPack.ba7c31204b0547bc86b04d888ac59d63</ManagementPackName>
          <ManagementPackVersion>7.5.3079.0</ManagementPackVersion>
        </Category>
        <Category ID="ServiceManager.Console.NotificationManagement.NotificationTemplates.Enumerationfda5fdec_6fef_4b83_9463_7a040d29df1d.Category" Target="Template_03c102548d044300a31a80a052de72db" Value="EnterpriseManagement1!ServiceManager.Console.NotificationManagement.NotificationTemplates.Enumeration" />
        <Category ID="Category.864ab7bd20a24405b4a0d07d29f0dce7" Target="NotificationSubscription_a8ad90b9_cad4_41d5_a113_7b930c6f3d91" Value="EnterpriseManagement1!Microsoft.EnterpriseManagement.ServiceManager.Rules.WorkflowSubscriptions" />
      </Categories>
      <Monitoring>
        <Discoveries>
          <Discovery ID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f.Discovery" Enabled="true" Target="WorkItemGroup.dd742218956b41d481007bb0f9196b3f" ConfirmDelivery="false" Remotable="true" Priority="Normal">
            <Category>Discovery</Category>
            <DiscoveryTypes>
              <DiscoveryRelationship TypeID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident" />
            </DiscoveryTypes>
            <DataSource ID="GroupPopulationDataSource" TypeID="SystemCenter!Microsoft.SystemCenter.GroupPopulator">
              <RuleId>$MPElement$</RuleId>
              <GroupInstanceId>$MPElement[Name="WorkItemGroup.dd742218956b41d481007bb0f9196b3f"]$</GroupInstanceId>
              <MembershipRules>
                <MembershipRule>
                  <MonitoringClass>$MPElement[Name='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']$</MonitoringClass>
                  <RelationshipClass>$MPElement[Name='WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident']$</RelationshipClass>
                  <Expression>
                    <SimpleExpression>
                      <ValueExpression>
                        <Property>$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem.TroubleTicket']/Priority$</Property>
                      </ValueExpression>
                      <Operator>Equal</Operator>
                      <ValueExpression>
                        <Value>1</Value>
                      </ValueExpression>
                    </SimpleExpression>
                  </Expression>
                </MembershipRule>
              </MembershipRules>
            </DataSource>
          </Discovery>
        </Discoveries>
        <Rules>
          <Rule ID="NotificationSubscription_a8ad90b9_cad4_41d5_a113_7b930c6f3d91" Enabled="true" Target="SystemCenter!Microsoft.SystemCenter.SubscriptionWorkflowTarget" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
            <Category>System</Category>
            <DataSources>
              <DataSource ID="DS" TypeID="SystemCenter1!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule">
                <Subscription>
                  <RelationshipSubscription RelType="$MPElement[Name='WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident']$" SourceType="$MPElement[Name='WorkItemGroup.dd742218956b41d481007bb0f9196b3f']$" TargetType="$MPElement[Name='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']$">
                    <AddRelationship />
                  </RelationshipSubscription>
                  <PollingIntervalInSeconds>10</PollingIntervalInSeconds>
                  <BatchSize>100</BatchSize>
                </Subscription>
              </DataSource>
            </DataSources>
            <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>155291e4-836b-96d3-82b5-18674c72a05b</Item>
                      </WorkflowArrayParameter>
                      <WorkflowArrayParameter Name="PrimaryUserList" Type="string">
                        <Item>1323ccce-0672-beba-ec4c-73ebb3159241</Item>
                      </WorkflowArrayParameter>
                    </WorkflowParameters>
                    <RetryExceptions />
                    <RetryDelaySeconds>60</RetryDelaySeconds>
                    <MaximumRunningTimeSeconds>7200</MaximumRunningTimeSeconds>
                  </WindowsWorkflowConfiguration>
                </Subscription>
              </WriteAction>
            </WriteActions>
          </Rule>
        </Rules>
      </Monitoring>
      <Templates>
        <ObjectTemplate ID="Template_03c102548d044300a31a80a052de72db" TypeID="CustomSystem_Notifications_Library!System.Notification.Template.SMTP">
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template.SMTP']/Subject$">&lt;1033&gt;An Incident was added to the Priority 1 Queue [$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$]&lt;/1033&gt;</Property>
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template.SMTP']/Priority$">2</Property>
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template.SMTP']/IsBodyHtml$">False</Property>
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template']/Content$">&lt;1033&gt;Incident: $Context/Property[Type='CustomSystem_Library!System.Entity']/DisplayName$&lt;/1033&gt;</Property>
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template']/Encoding$">utf-8</Property>
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template']/SeedClass$">System.WorkItem.Incident$a604b942-4c7b-2fb2-28dc-61dc6f465c68</Property>
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template']/Protocol$">SMTP</Property>
        </ObjectTemplate>
      </Templates>
      <LanguagePacks>
        <LanguagePack ID="ENU" IsDefault="false">
          <DisplayStrings>
            <DisplayString ElementID="ManagementPack.ba7c31204b0547bc86b04d888ac59d63">
              <Name>Coretech - Notification - Incident Added to Queue</Name>
            </DisplayString>
            <DisplayString ElementID="Template_03c102548d044300a31a80a052de72db">
              <Name>Coretech - Notification Template - Incident Added to Queue: Priority 1</Name>
            </DisplayString>
            <DisplayString ElementID="NotificationSubscription_a8ad90b9_cad4_41d5_a113_7b930c6f3d91">
              <Name>Coretech - Incident is added to a Queue: Priority 1</Name>
            </DisplayString>
            <DisplayString ElementID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f">
              <Name>Coretech - Incident - Prio 1</Name>
            </DisplayString>
            <DisplayString ElementID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident">
              <Name>WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident</Name>
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
        <LanguagePack ID="DAN" IsDefault="false">
          <DisplayStrings>
            <DisplayString ElementID="Template_03c102548d044300a31a80a052de72db">
              <Name>Coretech - Notification Template - Incident Added to Queue: Priority 1</Name>
            </DisplayString>
            <DisplayString ElementID="NotificationSubscription_a8ad90b9_cad4_41d5_a113_7b930c6f3d91">
              <Name>Coretech - Incident is added to a Queue: Priority 1</Name>
            </DisplayString>
            <DisplayString ElementID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f">
              <Name>Coretech - Incident - Prio 1</Name>
            </DisplayString>
            <DisplayString ElementID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident">
              <Name>WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident</Name>
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
      </LanguagePacks>
    </ManagementPack>


    • Marked as answer by Dolly1892 Monday, March 7, 2016 2:42 PM
    Friday, March 4, 2016 4:14 PM

All replies

  • Hi Paul,

    you can easily fire a notification when a item is added to a specific Queue. This is described in the section "Notify a Support Group DL that an Incident is in the queue" of the following article:

    Service Manager 101 - Focus on Incident Management

    I would recommend reading this from top to bottom as it contains the basics of Incident Management in SCSM. 

    Hope this helps. Regards,


    Stoyan (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" where applicable. This helps the community, keeps the forums tidy, and recognizes useful contributions. Thanks!)

    Friday, March 4, 2016 10:37 AM
  • HI Stoyan, we've been using incident mgt for a long time now but mostly got along with workflows. Queues and Subscriptions as far more helpful IMO but harder to put together, hence my specific query
    Friday, March 4, 2016 10:58 AM
  • Hi Stoyan

    I'm afraid this doesn't appear to be the answer I hoped it was. I already employ subscriptions of this type when work items are assigned to teams.

    This scenario is very specific to the lack of a date picker in the building of a subscription that mirrors the functionality of that in building a queue. All that has changed is that the SSD is within the next 7 days (relative to now) - absurdly, you cannot specifiy that condition in the subscription - so how can we trigger an e-mail when it forms a relationship between these conditions by occupying the queue?

    Whilst it is quite a simple scenario to discuss, workflows are not the answer either as they do not have the 'Relative to' option either when building the criteria.

    Thank you!


    • Edited by Dolly1892 Friday, March 4, 2016 11:33 AM
    Friday, March 4, 2016 11:29 AM
  • Yes you are right, the article is confusing the SCSM term queue with the meaning of "a queue".

    Technically this is possible, actually when you are making a queue, you are also making a new relationshipclass called: WorkItemGroup.<some guid>_Contains_<your target class>

    This is the reason why the console gives you a warning if you ever tried to import a management pack with queues.  Since this is an EntityType in which other configuration could point to, it's not legal unless the MP with the queue is sealed or that configuration with the queue-relationshipclass as source resides in the same management pack as the queue.

    Anyways .. what kind of subscription is needed here? Yes you guessed it: a relationship subscription. Just the same way as Assigned To user works.

    I have attached an example management pack here you can look at. It has a queue: Incident Priority 1, and a relationship subscription that triggers when a new Incident is added to this queue.

    Here's the important part:

    <RelationshipType ID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident" Accessibility="Public" Abstract="false" Base="CustomSystem_WorkItem_Library!System.WorkItemGroupContainsWorkItems">
              <Source ID="ContainedByGroup" MinCardinality="0" MaxCardinality="2147483647" Type="WorkItemGroup.dd742218956b41d481007bb0f9196b3f" />
              <Target ID="GroupContains" MinCardinality="0" MaxCardinality="2147483647" Type="CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident" />
            </RelationshipType>

    Here you need to replace: Relationship Type Id, Source and Target with the ones you need. I know this is a bit technical, but you can find some more readings on this here (Scenario 5)

    Full Management Pack (only for testing, don't import in prod env):

    <ManagementPack ContentReadable="true" SchemaVersion="2.0" OriginalSchemaVersion="1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <Manifest>
        <Identity>
          <ID>ManagementPack.ba7c31204b0547bc86b04d888ac59d63</ID>
          <Version>7.5.3079.0</Version>
        </Identity>
        <Name>Coretech - Notification - Incident Added to Queue</Name>
        <References>
          <Reference Alias="EnterpriseManagement">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
            <Version>7.5.3079.367</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_Notifications_Library">
            <ID>System.Notifications.Library</ID>
            <Version>7.5.3079.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_WorkItem_Library">
            <ID>System.WorkItem.Library</ID>
            <Version>7.5.3079.367</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_Library">
            <ID>System.Library</ID>
            <Version>7.5.8501.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="SystemCenter">
            <ID>Microsoft.SystemCenter.Library</ID>
            <Version>7.0.8433.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="SystemCenter1">
            <ID>Microsoft.SystemCenter.Subscriptions</ID>
            <Version>7.5.3079.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="EnterpriseManagement1">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Administration</ID>
            <Version>7.5.3079.367</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_WorkItem_Incident_Library">
            <ID>System.WorkItem.Incident.Library</ID>
            <Version>7.5.3079.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
        </References>
      </Manifest>
      <TypeDefinitions>
        <EntityTypes>
          <ClassTypes>
            <ClassType ID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f" Accessibility="Public" Abstract="false" Base="CustomSystem_WorkItem_Library!System.WorkItemGroup" Hosted="false" Singleton="true" Extension="false" />
          </ClassTypes>
          <RelationshipTypes>
            <RelationshipType ID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident" Accessibility="Public" Abstract="false" Base="CustomSystem_WorkItem_Library!System.WorkItemGroupContainsWorkItems">
              <Source ID="ContainedByGroup" MinCardinality="0" MaxCardinality="2147483647" Type="WorkItemGroup.dd742218956b41d481007bb0f9196b3f" />
              <Target ID="GroupContains" MinCardinality="0" MaxCardinality="2147483647" Type="CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident" />
            </RelationshipType>
          </RelationshipTypes>
        </EntityTypes>
      </TypeDefinitions>
      <Categories>
        <Category ID="Category.c39053258e4e4aa49983dd12ccaf6bf2" Value="EnterpriseManagement!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
          <ManagementPackName>ManagementPack.ba7c31204b0547bc86b04d888ac59d63</ManagementPackName>
          <ManagementPackVersion>7.5.3079.0</ManagementPackVersion>
        </Category>
        <Category ID="ServiceManager.Console.NotificationManagement.NotificationTemplates.Enumerationfda5fdec_6fef_4b83_9463_7a040d29df1d.Category" Target="Template_03c102548d044300a31a80a052de72db" Value="EnterpriseManagement1!ServiceManager.Console.NotificationManagement.NotificationTemplates.Enumeration" />
        <Category ID="Category.864ab7bd20a24405b4a0d07d29f0dce7" Target="NotificationSubscription_a8ad90b9_cad4_41d5_a113_7b930c6f3d91" Value="EnterpriseManagement1!Microsoft.EnterpriseManagement.ServiceManager.Rules.WorkflowSubscriptions" />
      </Categories>
      <Monitoring>
        <Discoveries>
          <Discovery ID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f.Discovery" Enabled="true" Target="WorkItemGroup.dd742218956b41d481007bb0f9196b3f" ConfirmDelivery="false" Remotable="true" Priority="Normal">
            <Category>Discovery</Category>
            <DiscoveryTypes>
              <DiscoveryRelationship TypeID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident" />
            </DiscoveryTypes>
            <DataSource ID="GroupPopulationDataSource" TypeID="SystemCenter!Microsoft.SystemCenter.GroupPopulator">
              <RuleId>$MPElement$</RuleId>
              <GroupInstanceId>$MPElement[Name="WorkItemGroup.dd742218956b41d481007bb0f9196b3f"]$</GroupInstanceId>
              <MembershipRules>
                <MembershipRule>
                  <MonitoringClass>$MPElement[Name='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']$</MonitoringClass>
                  <RelationshipClass>$MPElement[Name='WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident']$</RelationshipClass>
                  <Expression>
                    <SimpleExpression>
                      <ValueExpression>
                        <Property>$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem.TroubleTicket']/Priority$</Property>
                      </ValueExpression>
                      <Operator>Equal</Operator>
                      <ValueExpression>
                        <Value>1</Value>
                      </ValueExpression>
                    </SimpleExpression>
                  </Expression>
                </MembershipRule>
              </MembershipRules>
            </DataSource>
          </Discovery>
        </Discoveries>
        <Rules>
          <Rule ID="NotificationSubscription_a8ad90b9_cad4_41d5_a113_7b930c6f3d91" Enabled="true" Target="SystemCenter!Microsoft.SystemCenter.SubscriptionWorkflowTarget" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
            <Category>System</Category>
            <DataSources>
              <DataSource ID="DS" TypeID="SystemCenter1!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule">
                <Subscription>
                  <RelationshipSubscription RelType="$MPElement[Name='WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident']$" SourceType="$MPElement[Name='WorkItemGroup.dd742218956b41d481007bb0f9196b3f']$" TargetType="$MPElement[Name='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']$">
                    <AddRelationship />
                  </RelationshipSubscription>
                  <PollingIntervalInSeconds>10</PollingIntervalInSeconds>
                  <BatchSize>100</BatchSize>
                </Subscription>
              </DataSource>
            </DataSources>
            <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>155291e4-836b-96d3-82b5-18674c72a05b</Item>
                      </WorkflowArrayParameter>
                      <WorkflowArrayParameter Name="PrimaryUserList" Type="string">
                        <Item>1323ccce-0672-beba-ec4c-73ebb3159241</Item>
                      </WorkflowArrayParameter>
                    </WorkflowParameters>
                    <RetryExceptions />
                    <RetryDelaySeconds>60</RetryDelaySeconds>
                    <MaximumRunningTimeSeconds>7200</MaximumRunningTimeSeconds>
                  </WindowsWorkflowConfiguration>
                </Subscription>
              </WriteAction>
            </WriteActions>
          </Rule>
        </Rules>
      </Monitoring>
      <Templates>
        <ObjectTemplate ID="Template_03c102548d044300a31a80a052de72db" TypeID="CustomSystem_Notifications_Library!System.Notification.Template.SMTP">
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template.SMTP']/Subject$">&lt;1033&gt;An Incident was added to the Priority 1 Queue [$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$]&lt;/1033&gt;</Property>
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template.SMTP']/Priority$">2</Property>
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template.SMTP']/IsBodyHtml$">False</Property>
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template']/Content$">&lt;1033&gt;Incident: $Context/Property[Type='CustomSystem_Library!System.Entity']/DisplayName$&lt;/1033&gt;</Property>
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template']/Encoding$">utf-8</Property>
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template']/SeedClass$">System.WorkItem.Incident$a604b942-4c7b-2fb2-28dc-61dc6f465c68</Property>
          <Property Path="$Context/Property[Type='CustomSystem_Notifications_Library!System.Notification.Template']/Protocol$">SMTP</Property>
        </ObjectTemplate>
      </Templates>
      <LanguagePacks>
        <LanguagePack ID="ENU" IsDefault="false">
          <DisplayStrings>
            <DisplayString ElementID="ManagementPack.ba7c31204b0547bc86b04d888ac59d63">
              <Name>Coretech - Notification - Incident Added to Queue</Name>
            </DisplayString>
            <DisplayString ElementID="Template_03c102548d044300a31a80a052de72db">
              <Name>Coretech - Notification Template - Incident Added to Queue: Priority 1</Name>
            </DisplayString>
            <DisplayString ElementID="NotificationSubscription_a8ad90b9_cad4_41d5_a113_7b930c6f3d91">
              <Name>Coretech - Incident is added to a Queue: Priority 1</Name>
            </DisplayString>
            <DisplayString ElementID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f">
              <Name>Coretech - Incident - Prio 1</Name>
            </DisplayString>
            <DisplayString ElementID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident">
              <Name>WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident</Name>
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
        <LanguagePack ID="DAN" IsDefault="false">
          <DisplayStrings>
            <DisplayString ElementID="Template_03c102548d044300a31a80a052de72db">
              <Name>Coretech - Notification Template - Incident Added to Queue: Priority 1</Name>
            </DisplayString>
            <DisplayString ElementID="NotificationSubscription_a8ad90b9_cad4_41d5_a113_7b930c6f3d91">
              <Name>Coretech - Incident is added to a Queue: Priority 1</Name>
            </DisplayString>
            <DisplayString ElementID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f">
              <Name>Coretech - Incident - Prio 1</Name>
            </DisplayString>
            <DisplayString ElementID="WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident">
              <Name>WorkItemGroup.dd742218956b41d481007bb0f9196b3f_Contains_System.WorkItem.Incident</Name>
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
      </LanguagePacks>
    </ManagementPack>


    • Marked as answer by Dolly1892 Monday, March 7, 2016 2:42 PM
    Friday, March 4, 2016 4:14 PM