Like most everything with Jamf, there are a lot of ways to climb a tree, but here's one idea - you could add something to the policy that was a marker.
A one liner like this in the files and processes/execute command field (obviously change the policy name to something meaningful).

touch /Library/Application\\ Support/JAMF/policyxxx
Then create an extension attribute script that looks for that and returns a result you can search against.

#!/bin/bash
printf '<result>'
if [[ -f /Library/Application\\ Support/JAMF/policyxxx ]];then
printf 'policyxxx'
fi
printf '</result>'
Then use a smart group or a saved advanced search based on department and the extension attribute having that marker.

Or you could for instance create a group that didn't thave that marker and use it to run the policy... so many ways to extend it.
And if I can give you a tip on the re-scoping... in short, use the APIs. ;)
This seems like an extraordinary amount of work. And i don't even completely understand what it does, but to set this ext att to every policy would take me hours.
I will have a look into the API.
I am still convinced there must be an easier way to show all the policies scoped for one Department. thank you nevertheless.
Hi johnjohn --
If you're looking to do this via the API, here's some Python code that'll list all the policies and configuration profiles scoped to a particular department:
https://github.com/MatthewPrins/Jamf/blob/main/Policies_Profiles_Department.py
Hi johnjohn --
If you're looking to do this via the API, here's some Python code that'll list all the policies and configuration profiles scoped to a particular department:
https://github.com/MatthewPrins/Jamf/blob/main/Policies_Profiles_Department.py
This is pretty much what i was looking for and i can confirm it works. And as a bonus there's a bunch of other really useful scripts in that library
This is pretty much what i was looking for and i can confirm it works. And as a bonus there's a bunch of other really useful scripts in that library
Glad it worked for your situation!