In my IDN Workflow - with trigger set to Provisioning Completed - my goal is to filter using JSONPath. I want to get all accountRequests objects that have source.name == ‘IdentityNow’, that have provisioningTarget == ‘IdentityNow’ and lastly that have any attributeRequests nested array objects that have attributeName == ‘assigned Roles’. So far i came up with this expression:
$.accountRequests[?(@.source.name == 'IdentityNow' && @.provisioningTarget == 'IdentityNow' && @.attributeRequests[?(@.attributeName == 'assignedRoles')])]
All online JSONPath evaluators are telling me there is an error in the last part of the expression.
Sample JSON looks like this :
{
"accountRequests":[
{
"source":{
"id":"xxxxxx",
"name":"IdentityNow",
"type":"SOURCE"
},
"accountId":"xxxx",
"accountOperation":"Modify",
"provisioningResult":"SUCCESS",
"provisioningTarget":"IdentityNow",
"ticketId":"7263219262",
"attributeRequests":[
{
"operation":"Add",
"attributeName":"memberOf",
"attributeValue":"xxxxx"
},
{
"attributeName":"assignedRoles",
"attributeValue":"Test 1",
"operation":"Add"
}
]
},
{
"source":{
"id":"xxxxxx",
"name":"IdentityNow",
"type":"SOURCE"
},
"accountId":"xxxx",
"accountOperation":"Modify",
"provisioningResult":"SUCCESS",
"provisioningTarget":"IdentityNow",
"ticketId":"7263219262",
"attributeRequests":[
{
"operation":"Add",
"attributeName":"test2",
"attributeValue":"xxxxx"
},
{
"attributeName":"test3",
"attributeValue":"Test 1",
"operation":"Add"
}
]
}
]
}
My JSONPath expression should only return first accountRequest object because the second one doesnt have any attributeRequests with attributeName == ‘assignedRoles’