The ability to limit how many times an Autotask workflow rule (WFR) will trigger is the 1st step in taking WFRs from basic “update a single field” activities to actually implementing a business workflow. Also, in one of my webinars on Autotask and Autotask WFRs I went over best practices for WFRs, and a key one was: always ensure you know when a WFR will trigger. This is part of that toolset.
For example, let’s say you want to ensure a customer is sent an email on new ticket creation, but you don’t want them to get a second “we got your new ticket” email if the ticket accidently is set back to Status=New? You want a way to identify if a WFR has already fired on the ticket.
If you think of a WFR like a programming construct, you’ll realize you need a variable of some type to hold the knowledge that “WFR has triggered once before”. That’s where a UDF comes in.
For our example, we’ll create a Ticket UDF “Customer Sent New Ticket Email” as a List (Single Select) type. We’ll then create the List Options of Yes and No.
Then, in the WFR we use to send customer emails we’ll use this UDF as a conditional and update it when the WFR triggers. This only requires a single WFR. NOTE: Notice how my conditional is “IS NOT YES” instead of “IS NO”. When dealing with UDFs, generally you want to test the negative. That’s because creating a UDF doesn’t “auto update” existing tickets, so the UDF may be EMPTY instead of Yes or No, and so the negative test deals with that situation. Also note that we update the UDF if the WFR fires. The WFR will only fire if the UDF is NOT YES, so the update only fires once.