this is the workflow we tried @gmilunich can you please suggest what is wrong
{
"name": "Forward Certifications on Manager Termination",
"description": "When a manager is terminated, all their pending certification reviews are reassigned to their manager.",
"definition": {
"start": "Get Terminated Manager",
"steps": {
"Get Terminated Manager": {
"actionId": "sp:get-identity",
"attributes": {
"id.$": "$.trigger.identity.id"
},
"displayName": "Get Terminated Manager Details",
"nextStep": "Get Managers Manager",
"type": "action",
"versionNumber": 2
},
"Get Managers Manager": {
"actionId": "sp:get-identity",
"attributes": {
"id.$": "$.getTerminatedManager.managerRef.id"
},
"displayName": "Get Manager’s Manager Details",
"nextStep": "Get Campaigns",
"type": "action",
"versionNumber": 2
},
"Get Campaigns": {
"actionId": "sp:http",
"attributes": {
"authenticationType": "OAuth",
"method": "get",
"oAuthClientId": "YOUR_CLIENT_ID",
"oAuthClientSecret": "$.secrets.YOUR_SECRET",
"oAuthCredentialLocation": "oAuthInHeader",
"oAuthTokenUrl": "https://XYZ.api.identitynow.com/oauth/token",
"url": "https://XYZ.api.identitynow.com/v2024/campaigns?filters=reviewer.id eq {{$.getTerminatedManager.id}}"
},
"displayName": "Get Certification Campaigns",
"nextStep": "Loop Campaigns",
"type": "action",
"versionNumber": 2
},
"Loop Campaigns": {
"actionId": "sp:loop:iterator",
"attributes": {
"input.$": "$.getCampaigns.body",
"start": "Forward Certification",
"steps": {
"Forward Certification": {
"actionId": "sp:http",
"attributes": {
"authenticationType": "OAuth",
"method": "post",
"oAuthClientId": "YOUR_CLIENT_ID",
"oAuthClientSecret": "$.secrets.YOUR_SECRET",
"oAuthCredentialLocation": "oAuthInHeader",
"oAuthTokenUrl": "https://XYZ.api.identitynow.com/oauth/token",
"requestContentType": "json",
"url": "https://XYZ.api.identitynow.com/v2024/campaigns/{{$.loop.loopInput.id}}/reassign",
"jsonRequestBody": {
"fromIdentityId": "{{$.getTerminatedManager.id}}",
"toIdentityId": "{{$.getManagersManager.id}}",
"comment": "Reassigned because manager was terminated"
}
},
"displayName": "Forward Certification",
"nextStep": "End Loop",
"type": "action",
"versionNumber": 2
},
"End Loop": {
"actionId": "sp:operator-success",
"displayName": "Certification Forwarded",
"type": "success"
}
}
},
"displayName": "Loop Through Campaigns",
"nextStep": "End Workflow",
"type": "action",
"versionNumber": 1
},
"End Workflow": {
"actionId": "sp:operator-success",
"displayName": "Workflow Complete",
"type": "success"
}
}
},
"trigger": {
"type": "EVENT",
"attributes": {
"filter.$": "$.changes[?(@.attribute == \"cloudLifecycleState\" && @.newValue == \"terminatedDisabled\")]",
"id": "idn:identity-attributes-changed"
}
}
}