Help With Workflow Trigger Multiple Attributes

:bangbang: 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.

Greetings All,

I am trying to create a workflow that will trigger when multiple identity attributes have changed. I am having a difficult time achieving that.
Specifically, I want the workflow to only be triggered when department, jobTitle and manager attributes have changed. Example { "identity": { "id": "1234", "name": "John Doe", "type": "IDENTITY" }, "changes": [ { "attribute": "position", "oldValue": "sales exec", "newValue": "marketing exec" }, { "attribute": "manager", "oldValue": { "id": "ee769173319b41d19ccec6c235423237b", "name": "william.wilson", "type": "IDENTITY" }, "newValue": { "id": "ee769173319b41d19ccec6c235423236c", "name": "ed.engineer", "type": "IDENTITY" } }, { "attribute": "jobTitle", "oldValue": "sales", "newValue": "marketing" } ] }. I tried tried this filter $.changes[?((@.attribute=="manager" && @.attribute=="position"))] and a few others with no success.

Anyone please be kind to assist.

Regards,
Bhekamandla

Hi @Bhekamandla
try this filter
$.changes[?(@.attribute == “department” && @.attribute==“jobtitle” && @.attribute==“manager”)] This is the filter for which all three attributes need to be changed

If you need to trigger if anyone of this attributes changed then the filter will be as follows
$.changes[?(@.attribute == “department” || @.attribute==“jobtitle” || @.attribute==“manager”)]

here use the technical name of the attributes, and make sure the jobtitle is also an identity attribute

Thanks,
Tulasi

Hi @Bhekamandla

This filter can help you

$.changes[?((@.attribute == "department" && @.newValue == "newDept") && (@.attribute == "jobTitle" && @.newValue == "newTitle") && (@.attribute == "manager" && @.newValue.id == "newManagerId"))]

Describe your requirement as is , for accurate filter

Thanks

Hi @Bhekamandla,

Applying AND condition is a bit tricky on the identity attributes changed filter.

Can you try something like this and see if it works :

$[?(("position" in @.changes[*].attribute && "manager" in @.changes[*].attribute))]

1 Like

Hi @Tulasi ,

Thank you for the response. I had previously tried this and it did not work.
Still facing the same issue.

Regards

Hi @sidharth_tarlapally ,

Thanks for your response. I don’t need the newValue to be a specific value, I just need it to change. The requirement is that the workflow should be triggered when all three attributs change - regardsless of the values they are changing from or to.

Regards,
Bhekamandla

1 Like

Hi @jesvin90 ,

Thanks for your response. I tried this and it worked! I will do some testing of the different scenarios I have and provide feedback. Thanks a lot - I will accept the as a solution after the tests.

Regards,
Bhekamandla

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.