I am working on building a workflow that when an account moves to an inactive life cycle state that the api call is made to remove ISC roles for Helpdesk and Report Admin. I am trying to validate that the new value on the event call is inactive. When I try the below filtering I am always following the true statement and sending the api call. I am not sure what I am doing wrong with trying to compare the string values.
{
"id": "acb3eb79-0b4a-4232-b194-20dcd10a1e52",
"name": "Disable - TSC Access",
"description": "When a user moves to an inactive LCS remove Helpdesk and Reporting Admin roles for the account.",
"created": "2024-04-16T11:22:35.070844688Z",
"modified": "2024-04-16T12:56:27.909543041Z",
"modifiedBy": {
"type": "IDENTITY",
"id": "REMOVED",
"name": "REMOVED"
},
"definition": {
"start": "Compare Strings",
"steps": {
"Compare Strings": {
"choiceList": [
{
"comparator": "StringEquals",
"nextStep": "HTTP Request",
"variableA.$": "$.trigger.changes",
"variableB.$": "$.trigger.changes[?(@.newValue == \"inactive\")]"
}
],
"defaultStep": "End Step - Success 1",
"displayName": "",
"type": "choice"
},
"End Step - Success 1": {
"displayName": "",
"type": "success"
},
"HTTP Request": {
"actionId": "sp:http",
"attributes": {
"authenticationType": "OAuth",
"jsonRequestBody": [
{
"op": "remove",
"path": "/capabilities",
"value": [
"REPORT_ADMIN",
"HELPDESK"
]
}
],
"method": "patch",
"oAuthClientId": "REMOVED",
"oAuthClientSecret": "REMOVED",
"oAuthCredentialLocation": "oAuthInHeader",
"oAuthScope": null,
"oAuthTokenUrl": "REMOVED/oauth/token",
"requestContentType": "json",
"requestHeaders": {
"Accept": "application/json",
"Content-Type": "application/json-patch+json"
},
"url": "REMOVED/v3/auth_users/{{$.trigger.identity.id}}"
},
"description": null,
"displayName": "",
"nextStep": "End Step - Success 1",
"type": "action",
"versionNumber": 2
}
}
},
"enabled": false,
"executionCount": 0,
"failureCount": 0,
"creator": {
"type": "IDENTITY",
"id": "REMOVED",
"name": "REMOVED"
},
"owner": {
"type": "IDENTITY",
"id": "REMOVED",
"name": "REMOVED"
},
"trigger": {
"type": "EVENT",
"attributes": {
"attributeToFilter": "cloudLifecycleState",
"filter.$": "$.changes[?(@.attribute == \"cloudLifecycleState\")]",
"id": "idn:identity-attributes-changed"
}
}
}
TEST PAYLOAD TRUE:
{
"identity": {
"type": "IDENTITY",
"id": "6928225c4a8f4688a145ad5a1e77ee0a",
"name": "A Meyer, Cody"
},
"changes": [
{
"attribute": "cloudLifecycleState",
"oldValue": "active",
"newValue": "inactive"
}
]
}
TEST PAYLOAD FALSE:
{
"identity": {
"type": "IDENTITY",
"id": "6928225c4a8f4688a145ad5a1e77ee0a",
"name": "A Meyer, Cody"
},
"changes": [
{
"attribute": "cloudLifecycleState",
"oldValue": "inactive",
"newValue": "active"
}
]
}