7 Replies Latest reply on Oct 9, 2018 3:42 AM by IJU

    Business Rule and Triggered Actions

    JPOHDC Rookie

      So we have this Business Rule that runs to send an email to the Owner Team when a Service Request is opened, we wanted more information in this email to include the parameters of the Service Request. I found this expression $(ForEachChild("ServiceReq#", RecId, "ServiceReqParam#", "if Find('_hide_', ParameterName) != -1 then '' else ParameterName + ': ' + ParameterValue + '\r\n'", "CreatedDateTime ASC")) which works extremely well in gathering the parameters of the Requests. The issue is it work in all other Business Rules and Emails exceot this one. I narrowed it down to the ON Initialize check box. If I remove that check and only send the email on On Update it works. It also works on all other emails (Fulfillment, closed and cancelled).

       

      Here is example of what is sent when the Owner Team changes

      And this one is on Creation.

       

      Anyone with any ideas

        • 1. Re: Business Rule and Triggered Actions
          AnthonyDowns Specialist

          Hi JPOHDC,

           

          Did you try Object Event "On Insert"? That is what would trigger this rule when you saved a new ticket. "On initialize" should fire when the New Incident button is clicked. I think...

          • 2. Re: Business Rule and Triggered Actions
            JPOHDC Rookie

            I tried all combination and the only one that work was the On Update Field event, None of the other would work. This is specifically for Service Requests as well. So these are system generated tickets

            • 3. Re: Business Rule and Triggered Actions
              AnthonyDowns Specialist

              Hmm, try to make a new rule to test?

               

              I just tried this again on my test system and it worked. Although the email with the parameters was a little slow, two minutes after saving (On Creation) before it showed up.

               

              • 4. Re: Business Rule and Triggered Actions
                westy1 Apprentice

                you could also run it off the OwnerTeamEmail field, for some reason i have had more success with that field than the OwnerTeam field in the past

                • 5. Re: Business Rule and Triggered Actions
                  JPOHDC Rookie

                  Tried that as well with no luck, somethign so easy should work, I am at a loss

                  • 6. Re: Business Rule and Triggered Actions
                    lgtandi Specialist

                    As Anthony has stated, the "On Initialize" trigger is already fired if the service request is created and at this point in time, no service request parameters (as objects contained in the parent service request) could have been set or even created. Therefore, it is no surprise that nothing is included in the email triggered on initialization.

                     

                    I would suppose that you just trigger on updates of the field "OwnerTeam" and set the owner team as part of the request fulfillment workflow.

                    • 7. Re: Business Rule and Triggered Actions
                      IJU Specialist

                      Hello,

                       

                      we found in the past that combining these trigger checkboxes does never work as expected. You should always only use one trigger option. Not "on insert" AND "on update" at the same time. Only one or the other. If you want it triggered at both times you need to create two triggered actions, for each trigger one triggered action.

                       

                      Also timing is pretty important. Maybe you should set the trigger to "relationship" event. Choose the relationship to the parameters to make sure that the parameters are linked completely before sending out an email which uses informations from that exact paremeters record.

                       

                      Kind regards

                       

                      Immanuel Jungheim

                      Consultant

                       

                      ITSM Group – Be Better.

                      www.itsmgroup.com

                      1 of 1 people found this helpful