Jsonpath filter for trigger lifecycle state change

Hello Community,

Can somebody please give me an example of a JsonPath Filter for the trigger Identity Lifecycle state changed ? I am not finding anything even within the documentation,

Many thanks,

    "trigger": {
        "type": "EVENT",
        "attributes": {
            "attributeToFilter": "cloudLifecycleState",
            "filter.$": "$.changes[?(@.attribute == \"cloudLifecycleState\")]",
            "id": "idn:identity-attributes-changed"
        }
    }

hope this helps

Hi @bilal , thank you for your reply, i need to track if CloudLifecycleState changed to Active for example do i add @.newvalue?

Hi @torry_salamat

I suggest, use Identity Attribute Changed trigger and the filter
$.changes[?(@.attribute == "cloudLifecycleState" && @.newValue == "active") && ($.oldValue == "inactive")]

Thanks

Hello @sidharth_tarlapally , Thank you for your answer

do you know please what is the purpose of this new trigger lifecycle state change if we still use the identity change trigger? thanks

Hi Torry

Don’t have a sample of your exact use-case.

You could run a test, extract the trigger, and then test out with json path evaluator.

Here is a sample that might help, based on a provisioning-complete trigger.

    "trigger": {
        "type": "EVENT",
        "attributes": {
            "filter.$": "$.accountRequests[?(@.provisioningTarget == \"Salesforce \")].attributeRequests.[?(@.attributeValue== \"12345\" && @.operation==\"Add\")]",
            "id": "idn:post-provisioning"
        }
    }
1 Like

Try something like this

$.[?(@.newLifecycleState == 'active')]

based on input json format

{
  "identity": {
    "id": "ee769173319b41d19ccec6cea52f237b",
    "name": "john.doe",
    "type": "IDENTITY"
  },
  "oldLifecycleState": "preHire",
  "newLifecycleState": "active"
}

as per

1 Like

Hi @torry_salamat ,

For the Identity Lifecycle State Changed trigger, you can use the following JSONPath filter and tweak it as needed:


$[?(@.newLifecycleState == 'active' && (@.oldLifecycleState == 'inactive' || @.oldLifecycleState == 'preHire'))]

hope that helps!