cancel
Showing results for 
Search instead for 
Did you mean: 
Mike Nemer
Active Contributor

Option to set Triggers to execute one-time only

It would be nice if we could set triggers to execute only once.

For example, as it stands, let's say you have a trigger set to auto-comment based on a given Custom Field being "Yes". The first time that Custom Field is changed to "Yes," the trigger fires, you get your auto-response, everything is great.

However, if you make other updates to the incident and need to re-save, but that Custom Field still shows "Yes", then the trigger fires a 2nd time when you save, thus duplicating your auto-comment. And on and on, every time you save.

Why can't we set triggers to execute once? I feel like this should be a simple feature-addition, but a huge quality of life change.
3 REPLIES 3
SaschaZ
Retired GoTo Contributor

Re: Option to set Triggers to execute one-time only

Hi Mike,

Service Desk doesn't currently support "fire once" triggers but that's an interesting use case that you're presenting. If the custom field is changed to YES, then NO, then back to YES, would you expect the trigger to fire again or not? Should the trigger fire on update to the appropriate value or only 1 regardless of what happens after?

Thanks for the feedback!
Mike Nemer
Active Contributor

Re: Option to set Triggers to execute one-time only

Hi Sascha,

Thanks for the response! I think it would be helpful if we had an option to choose between both scenarios for any given trigger. For example, after setting your trigger parameters, what if the following was an option:

"How often should this trigger fire?"

1) Every time parameters are met

2) Only the first time parameters are met. Ignore thereafter.


Does that make sense? I don't know anything about how hard this would be to code, but it would be a welcome addition if possible.

Thanks again,

Mike

Joshua Davidson
Active Contributor

Re: Option to set Triggers to execute one-time only

I absolutely agree, this would be very useful. Sometimes there are tricky ways to get it to run once depending on what you're doing, but it takes sacrificing a built-in priority slot (or maybe some other type of field) and an extra step that can be a pain. Consider doing something like this:

Step 1.) Change your P5 priority, call it "Ticket Received", "Unassigned", or "Not yet prioritized" or whatever makes sense to you (you can't create a new priority because you have to use built-in priority levels in triggers).

Step 2.) Change your default priority to P5 so ALL incoming tickets that have yet to be assigned will be P5.

Step 3.) Now add an extra qualifier in your trigger:
Priority level is equal to P5, check that ALL conditions must be true. Set up the rest of the trigger as desired.

Now, when a ticket comes in, it comes in at P5. The technician will do whatever the cause of the trigger is (assign a new priority, or assign a customer, etc) and that will trigger the action for the first time. Then the technician will assign the priority as appropriate and thereafter any time the trigger WOULD have been applied, it doesn't get re-run because the extra qualifier of P5 is not met.

Not an ideal workaround but it can work and be worth the effort, depending on what you're doing.