Lifecycle State Change JsonPath expression

Hello Community,

I’m working on a workflow and I want it to trigger only in the following cases:

  1. When the newValue of lifecycleState is “State1”, regardless of the oldValue.

  2. Or when the oldValue is null and the newValue is “State2”.

Here’s the JSONPath filter I used:

$.changes[?(@.attribute == "cloudLifecycleState" && ((@.newValue == "State1") || (@.oldValue == null && @.newValue == "State2")))]

However, it doesn’t seem to work as expected.
Has anyone encountered a similar issue or can spot what might be wrong with this condition?

Thanks in advance!:grinning_face:

Hey @torry_salamat

Refer this Jsonpath filter for trigger lifecycle state change - #9 by kalyan_dev32

Hello @kalyan_dev32 , I tried it when my usecase was simple it was working fine but now the usecase changed to something more complex with this “OR OPERATOR” situation that is making the JsonPath not working as expected unfortunately..

I don’t see any issue with your filter logic. From what you described, it behaves as expected. However, make sure that the values you’re comparing (like stale1 and stale2) match the technical names of the lifecycle states, not just their display labels

see below for reference

Hi i don’t know why but it doesn’t work as expected.. it’s getting executed when lifecycle is equal to another state other than state2 and state1 and even when oldValue is something else than null and newValue is State2..

Hi @torry_salamat

How are you testing it, through the test workflow or after actually enabling it? If you’re using the test workflow, it sometimes triggers under all conditions.

Hi @UjjwalJain it’s actually after enabling it and testing it

Hello,

I’m still facing the same issue: the workflow does not trigger for newly created identities that should receive State1 as the newValue. However, if an identity already has a different cloudLifecycleState and we change it to State1, the workflow triggers correctly.

Do you have any suggestions on how to debug this behavior?

Thank you.

Hi, quick so you donot see the trigger happening for new users right.

So that could be expected according to me.

What i would suggest you to try is:

  1. Create a even trigger for LCS Changed with not filters, and one with the filter as same you have given in the workflow and try to create a new user.
  2. Then validate the steps on what happens in both

As per my understanding sailpoint does not triggers for newly created identities, (null->someValue).

Thanks,

Hello,

You are right, the trigger wasn’t working only on newly created identities,

Thank you so much for your help

1 Like