Provisioning completed workflow trigger not working when more than 1 entitlement is added in the provisioning plan

Hi all,
I have an issue with a provisioning completed trigger which the trigger is not fired when more than 1 entitlement is added to the user in the same provisioning plan. The workflow is triggered when only 1 of the listed entitlements are added to the user, but not if more are included in the plan. This is the trigger I have currently;

$.accountRequests[?(@.source.id == “xxxx”)].attributeRequests[?(@.operation == “Add” && (@.attributeValue == “xxxx” || @.attributeValue == “yyyy” || @.attributeValue == “zzzz” ))]
I have also tried this one and same result;

$.accountRequests[?(@.attributeRequests[*].attributeValue anyof [“xxxx”,“yyyy”,“zzzz”,“vvvv”])]

Anyone have any ideas of other possibilities?

@Menzowskii - Have you validate against with - JSON Path Evaluator ?

Hi Kannan, yes I have and this is the result. As you can see, if there are 3 provisioning requests in the plan then the workflow should still be triggered. (This is validating against the 1st trigger I provided)

Have you tried replace OR chain with in? -

$.accountRequests[?(@.source.id == "xxxx")].attributeRequests[?(@.operation == "Add" && @.attributeValue in ["xxxx","yyyy","zzzz"])]

or - with [*] + contains instead of filtering per element?

$.accountRequests[?(@.source.id == "xxxx" && (@.attributeRequests[*].attributeValue contains "xxxx" || @.attributeRequests[*].attributeValue contains "yyyy" || @.attributeRequests[*].attributeValue contains "zzzz"))]

Try this and share your output.

Regards,

Kannan

Hello @Menzowskii ,

I’m able to get the result for the same JSON path that you are using. Only change I would recommend is, instead of using “” use ’

$.accountRequests[?(@.source.id == ‘4e4d982dddff4267ab12f0f1e72b5a6d’)].attributeRequests[?(@.operation==‘Add’ && (@.attributeValue==‘Reader’ || @.attributeValue==‘Tester’))]

Hi Theja,
Thanks for your response! I replaced the “” with ’ which also works in the JSON Evaluator. It’s just when I perform an actual test in the tenant adding 3 entitlements (where at least 1 of is defined in the trigger) to a user, that the workflow is not triggered. But when I add just 1 entitlement (that is defined in the trigger) it does trigger the workflow.
Seems like this could be a bug to me?

I tried those triggers in the evaluator as well which returned an empty array, and the 2nd trigger returned “JSON Path evaluation error: mismatched parentheses at 20”.
I am leaning towards the assumption that it could be a bug with the trigger.

Hi @Menzowskii ,

What I have noticed is JSON Input is different of what we are assuming, attributeVlaue is an array List for the no.of entitlements we are adding (In your case adding 3 entitlements to a user using AP or role).

In this case, you can use contains operator in your JSON path. This is working. Make sure you are closing the parenthesis correctly

$.accountRequests[?(@.source.id==‘xxxx’)].attributeRequests[?(@.operation==‘Add’ && (@.attributeValue contains “xxxx” || @.attributeValue contains “yyyy”))]

Ah check, yeah I did not know exactly what the JSON Input would be to be honest since I could only verify it against the workflow in which did trigger when only 1 entitlement was provisioned.
I have tried your solution using contains, but I am still receiving the parentheses error with this trigger:
$.accountRequests[?(@.source.id==‘xxxx’)].attributeRequests[?(@.operation==‘Add’ && (@.attributeValue contains “xxxx” || @.attributeValue contains “yyyy”))]

Maybe I am missing something but it seems like the contains operation does not work as expected?

This trigger;
$.accountRequests[?(@.source.id==‘xxxx’)].attributeRequests[?(@.operation==‘Add’ && (@.attributeValue==“xxxx” || @.attributeValue==“yyyy”))]
Seems to work but returns an empty array. “[]”

That’s strange. I would recommend checking the query with copilot for quotes " ’ issue. Please ignore the issue where it says contains operator cannot be parsed

I have evaluated to false test case as well

Hi Theja,
I see you are using the Event Trigger & Web Service Connector ‘implementation’ rather than workflows. I have now also changed to this which provided me with the correct evaluation results which is good, so thanks for the help!

Do you mind explaining why you are using that ‘implementation’ rather than the workflow implementation on the evaluator?