Custom Event Triggers

user-mBVrFoEtXa
New Contributor

I would like to trigger the same policy using different custom events.

For example -

  • jamf policy -event triggerA
  • jamf policy -event triggerB

will both trigger policy XYZ

I've tried adding the custom event triggerA, triggerB to policy XYZ, but it didn't work.

Is it a syntax issue, or is it simply not supported and I need to clone the policy instead? 

1 ACCEPTED SOLUTION

amakuch
New Contributor

Hi,

I believe Jamf supports only one custom trigger, however you can always use:

jamf policy -id PolicyID

 to trigger the policy.

View solution in original post

13 REPLIES 13

amakuch
New Contributor

Hi,

I believe Jamf supports only one custom trigger, however you can always use:

jamf policy -id PolicyID

 to trigger the policy.

mickgrant
Contributor III

Can you explain why you would need two different custom triggers for the same policy?

As part of my internal workflow, I need to rely on custom triggers, but would like to avoid duplicating the policy if possible.

the PolicyID trigger that @amakuch suggested works perfectly.

I still don't understand why you think you would need to duplicate the policy.
You can have any number of different items/scripts that all point back to the 1 core policy with the same trigger. The custom triggers are just a human-readable version of PolicyID ... they do the same thing.


Because the same custom trigger is applied to multiple different policies.

But I have a situation whereby I need to trigger only policyID 999, without triggering the other policies that have the same custom trigger. And in this case, using policyID as the trigger works perfectly for my case.

Ok, now I understand what was happening and what you needed to accomplish.

brockwalters
Contributor II

Each policy can only have 1 custom trigger / event string. There is no use case for what you are trying to do. The whole point of the customer trigger is that it is unique to the policy. If you want to call the same policy from different places & for some reason you don't like the trigger text, the -id flag is a good option. If you set multiple policies with the same trigger / event string they will execute in alphanumeric order based on the policy names. https://docs.jamf.com/10.26.0/jamf-pro/administrator-guide/About_Policies.html

you are simply wrong about there not being a use case - otherwise this question wouldn't have been posted in the first place.

@user-mBVrFoEtXa Well you can always make a feature request for including comma-separated strings in the custom trigger field @ https://ideas.jamf.com/

You have a grave misunderstanding about how the policy framework is supposed be used... 

I had a question about how it can be used, I asked about it and I've gotten helpful replies - all of which, are the purpose of this forum.

Whereas you are simply pedantic, insolent, and have no tangible contribution to this topic.

Actually, I suggested using the -id flag & I've given you the link to make a FR. Sometimes being told you don't understand something is actually the most helpful thing...

He has an edge case which he explained in a thread with me above, I just think in his original post he didn't explain it very well.
I actually do a similar thing for renaming Computers with DEPNotify.

In my DEP Notify script, I have a custom trigger called Rename_Computers.
That custom trigger is actually mapped to 5 separate policies that all fire off separate simple renaming scripts depending on the Site that the mac is going to. 
This works for me by restricting those policies to only be visible to each site.
So when DEPnotify runs, it calls the custom trigger but can only see 1 instance of the custom trigger.

It seems like he has come into a situation where a computer can see multiple policies with the same trigger but he just wants to activate 1 of them. so -PolicyID is the answer

Similarly, you being told that you are mistaken that there is no such use case is the most beneficial part for you in this thread.