locked
SCSM 2012 SP1 Incident Update Event - Creates Multiple e-mails RRS feed

  • Question

  • Incident Event Workflow Configuration -> Event Update is triggering duplicate e-mails.

    Any Solutions?

    Monday, February 18, 2013 7:13 AM

Answers

  • So basically you want a notification whenever the priority of the incident changes (as a result of changing the impact and/or urgency). This needs a little XML magic to accomplish. Follow these steps:

    1. Create the workflow with any sample criteria, such as "priority changed from equals 1, changed to does not equal 1"

    2. Export the Management Pack. The criteria section should look something like this

                      <Criteria>
                        <Expression>
                          <And>
                            <Expression>
                              <SimpleExpression>
                                <ValueExpression>
                                  <Property State="Pre">$Context/Property[Type='WorkItem!System.WorkItem.TroubleTicket']/Priority$</Property>
                                </ValueExpression>
                                <Operator>Equal</Operator>
                                <ValueExpression>
                                  <Value>1</Value>
                                </ValueExpression>
                              </SimpleExpression>
                            </Expression>
                            <Expression>
                              <SimpleExpression>
                                <ValueExpression>
                                  <Property State="Post">$Context/Property[Type='WorkItem!System.WorkItem.TroubleTicket']/Priority$</Property>
                                </ValueExpression>
                                <Operator>NotEqual</Operator>
                                <ValueExpression>
                                  <Value>1</Value>
                                </ValueExpression>
                              </SimpleExpression>
                            </Expression>
                          </And>
                        </Expression>
                      </Criteria>

    3. Change the <criteria> section to the following XML code

    <Criteria> <Expression> <SimpleExpression> <ValueExpression> <Property State="Pre">$Context/Property[Type='WorkItem!System.WorkItem.TroubleTicket']/Priority$</Property> </ValueExpression> <Operator>NotEqual</Operator> <ValueExpression> <Property State="Post">$Context/Property[Type='WorkItem!System.WorkItem.TroubleTicket']/Priority$</Property> </ValueExpression> </SimpleExpression> </Expression> </Criteria>


    4. Make sure that the alias "WorkItem!" in my example is the same like in your Management Pack

    5. Re-Import the Management Pack

    • Proposed as answer by C-C2k5 Wednesday, March 6, 2013 3:42 AM
    • Marked as answer by KSKARAN Tuesday, May 12, 2015 7:47 AM
    Tuesday, February 19, 2013 3:02 PM

All replies

  • What exact criteria have you configured for the workflow?
    Monday, February 18, 2013 11:33 AM
  • The Scenario as Follows

    New Incident Is Created

        Event is Create - No Criteria - Affected User email - This works fine

        Event is Update - Criteria (Status is = Active TO Status = Active) - Affected User Notification / Assigned To user Notification - This is where the Problem, gets duplicated

        Event is Update - Criteria (status is = Active TO Status = Resolved) - Affected User Notification - Works fine, but the above (Affected User Notification / Assigned To user Notification ) also gets Triggered

        The second (Event is Update) e-mail notification gets triggered for all of the associated workflows for a single Incident.

    Thanks..

    Monday, February 18, 2013 12:22 PM
  • This is the culprit: Event is Update - Criteria (Status is = Active TO Status = Active)

    This event gets triggered each time the incident is saved with the status set to Active. Also, when a workflow in the background changes anything on the incident while it is in the Active status, this notifiaction will be triggered.

    What exactly do you want to achieve with this notification?

    Monday, February 18, 2013 12:53 PM
  • Thank you for the prompt follow up

    Case Is

    A New Incident Is Created by the Console / Portal

    1. Event Create -> workflow -> Notify End User of Receipt of Ticket (Affected User) (No Problems Here)

    2. Event Update -> Tier-1 Engineer Updates (Urgency/Priority/Impact) Matrix  -> Notify End User of the New Matrix, Notify Analyst To Action (Staus Remains as = Active) (Problem Area)

    3. Event Update -> Analyst Actions ->Notify End User to Close / Reactivate based on the Task Completion (Status Changes = Resolved) (No Problems Here)

    4. And, so on till the ticket is closed before SLA Breach by the Assigned Analyst.

    Tuesday, February 19, 2013 2:49 AM
  • So basically you want a notification whenever the priority of the incident changes (as a result of changing the impact and/or urgency). This needs a little XML magic to accomplish. Follow these steps:

    1. Create the workflow with any sample criteria, such as "priority changed from equals 1, changed to does not equal 1"

    2. Export the Management Pack. The criteria section should look something like this

                      <Criteria>
                        <Expression>
                          <And>
                            <Expression>
                              <SimpleExpression>
                                <ValueExpression>
                                  <Property State="Pre">$Context/Property[Type='WorkItem!System.WorkItem.TroubleTicket']/Priority$</Property>
                                </ValueExpression>
                                <Operator>Equal</Operator>
                                <ValueExpression>
                                  <Value>1</Value>
                                </ValueExpression>
                              </SimpleExpression>
                            </Expression>
                            <Expression>
                              <SimpleExpression>
                                <ValueExpression>
                                  <Property State="Post">$Context/Property[Type='WorkItem!System.WorkItem.TroubleTicket']/Priority$</Property>
                                </ValueExpression>
                                <Operator>NotEqual</Operator>
                                <ValueExpression>
                                  <Value>1</Value>
                                </ValueExpression>
                              </SimpleExpression>
                            </Expression>
                          </And>
                        </Expression>
                      </Criteria>

    3. Change the <criteria> section to the following XML code

    <Criteria> <Expression> <SimpleExpression> <ValueExpression> <Property State="Pre">$Context/Property[Type='WorkItem!System.WorkItem.TroubleTicket']/Priority$</Property> </ValueExpression> <Operator>NotEqual</Operator> <ValueExpression> <Property State="Post">$Context/Property[Type='WorkItem!System.WorkItem.TroubleTicket']/Priority$</Property> </ValueExpression> </SimpleExpression> </Expression> </Criteria>


    4. Make sure that the alias "WorkItem!" in my example is the same like in your Management Pack

    5. Re-Import the Management Pack

    • Proposed as answer by C-C2k5 Wednesday, March 6, 2013 3:42 AM
    • Marked as answer by KSKARAN Tuesday, May 12, 2015 7:47 AM
    Tuesday, February 19, 2013 3:02 PM
  • Thanks for the Reply.

    On the initial pack (2) (priority changed from equals 1, changed to does not equal 1),

    <Operator>Equal</Operator>=<Value>1</Value> for "Pre"

    <Operator>NotEqual</Operator>=<Value>1</Value> for "Post"

    but on

    (3), it doesnot have any values,

    <Operator>NotEqual</Operator> = No Value for "Pre"

    No Conditio, No Value  for "Post" 

    how would this be processed?

    Kind of Lost.

    Wednesday, February 20, 2013 3:22 AM
  • This tells the workflow engine to trigger whenever the Pre-Value is not equal to the Post-Value.

    In other words: "Changed from SOMETHING to SOMETHING ELSE" :)

    Friday, February 22, 2013 11:13 AM
  • Has anyone tried this procedure(above) and found to be working when Priority  Changes from Something to Something, without any specific value
    Tuesday, May 12, 2015 6:08 AM
  • Just Tested this Procedure. Works fine to trigger an e-mail alert.

    Best practice : Use the same management pack to hold the (Incident ->Update) status Workflow as well as the Notification template for the e-mail. This way removing the MP will remove any problems created, if any

    Suggested tracks

    New Incident -> Assign Ownership(Primary Owner) (through the console) or through a default template 

    Workflow e-mail trigger assignment as follows Primary Owner -> Incident Priority Change Template (developed above as part of the MP)

    If any change done to Impact/Urgency, this will change the Priority (provided you use a priority calculation matrix), and as Dietner MP explains the workflow triggers along with the e-mail

    Tuesday, May 12, 2015 7:47 AM