Posted on 11-21-2022 11:08 PM
I would like to trigger the same policy using different custom events.
For example -
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?
Solved! Go to Solution.
Posted on 11-22-2022 01:56 AM
Hi,
I believe Jamf supports only one custom trigger, however you can always use:
jamf policy -id PolicyID
to trigger the policy.
Posted on 11-22-2022 01:56 AM
Hi,
I believe Jamf supports only one custom trigger, however you can always use:
jamf policy -id PolicyID
to trigger the policy.
Posted on 11-22-2022 02:13 PM
Can you explain why you would need two different custom triggers for the same policy?
Posted on 11-22-2022 06:35 PM
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.
Posted on 11-22-2022 06:43 PM
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.
Posted on 11-22-2022 07:04 PM
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.
Posted on 11-22-2022 07:14 PM
Ok, now I understand what was happening and what you needed to accomplish.
Posted on 11-22-2022 05:45 PM
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
Posted on 11-22-2022 06:35 PM
you are simply wrong about there not being a use case - otherwise this question wouldn't have been posted in the first place.
11-29-2022 01:37 PM - edited 11-29-2022 01:38 PM
@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...
Posted on 11-29-2022 07:26 PM
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.
Posted on 11-30-2022 03:44 PM
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...
Posted on 11-30-2022 03:54 PM
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
Posted on 12-04-2022 05:48 PM
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.