Please be sure you’ve read the docs and API specs before asking for help. Also, please be sure you’ve searched the forum for your answer before you create a new topic.
Hi Experts,
I’m looking for some guidance around filtering AD group data within a workflow in ISC.
Background
In our tenant, we have a large Active Directory source containing tens of thousands of AD groups.
As part of our application provisioning process, we’ve implemented ISC workflows that generate a ServiceNow ticket for a support team whenever access is added or removed. This is handled using the Provisioning Complete trigger, with a JSONPath expression to limit when the workflow executes.
Some applications are relatively simple (1–3 AD groups), while others are more complex (30+ AD groups).
The Problem
The issue arises during certification campaigns. When managers request the removal of multiple AD groups for a user, ISC sends all associated AD group removals within the deprovisioning request payload.
As a result, all AD groups are passed into the workflow and the downstream support teams receive tickets containing AD groups that are not relevant to their specific application.
Ideally, we only want the support team to see the AD group names that relate to their application—not every group included in the overall deprovisioning request. IE: What is in the JSONPath expression criteria.
We are currently using a JSONPath filter similar to the below for the input filtering:
$.accountRequests[?( @.source.name == "Active Directory")].attributeRequests[?((@.attributeValue contains "SG-Role-General-Users" || @.attributeValue contains "SG-Role-Admin-Users") && @.operation == "Remove")]
In the Manage ServiceNow ticket we have tried a few different ways to filter them out but that is very hit and miss.
Role: {{$.trigger.accountRequests[0].attributeRequests[0].attributeValue}}
Have also looked at Define Variable action inside and outside a Loop operation and trying to regex the data into a variable.
Any suggestions, examples, or design patterns would be greatly appreciated.
Thanks in advance!