Generic Workflow to Auto-Approve/Reject an access request

@Bassem_Mohamed - Is it possible to use requiredComment in a compare string. I have updated above code but it’s not entering into Loop.

{
“name”: “Auto-approved Requests testing”,
“description”: “Testing Auto-Approve WF”,
“modified”: “2024-02-15T15:40:24.783849721Z”,
“modifiedBy”: {
“type”: “IDENTITY”,
“id”: “495aa92b91xxxxxxxxxxxxxxxxxxxx”,
“name”: “hxxxxxxx”
},
“definition”: {
“start”: “HTTP Request”,
“steps”: {
“End Step — Success”: {
“type”: “success”
},
“HTTP Request”: {
“actionId”: “sp:http”,
“attributes”: {
“authenticationType”: “OAuth”,
“jsonRequestBody”: {
“input”: “{{$.loop.loopInput}}”
},
“method”: “get”,
“oAuthClientId”: “f6exxxxxxxxxxxxxxxxxxxxxxxxx”,
“oAuthClientSecret”: “$.secrets.d571f33xxxxxxxxxxxxxxxxxxxxx”,
“oAuthCredentialLocation”: “oAuthInHeader”,
“oAuthScope”: null,
“oAuthTokenUrl”: “https://coxxxxx-dev.api.identitynow.com/oauth/token”,
“requestContentType”: “json”,
“requestHeaders”: {
“Accept”: “application/json”
},
“url”: “https://coxxxxx-dev.api.identitynow.com/v3/access-request-approvals/pending”
},
“nextStep”: “Loop”,
“type”: “action”,
“versionNumber”: 2
},
“Loop”: {
“actionId”: “sp:loop:iterator”,
“attributes”: {
“input.$”: “$.hTTPRequest.body[?(@.requesterComment == “Request submitted by the Role Access Management Tool”)]”,
“start”: “Compare Strings”,
“steps”: {
“Approve Access Request”: {
“actionId”: “sp:approve-request”,
“attributes”: {
“approvalId.$”: “$.loop.loopInput.id”,
“comment”: “Auto-Approved by the Workflow”
},
“nextStep”: “End Step — Success 1”,
“type”: “action”,
“versionNumber”: 1
},
“Compare Strings”: {
“choiceList”: [
{
“comparator”: “StringEquals”,
“nextStep”: “Approve Access Request”,
“variableA.$”: “$.loop.loopInput.requesterComment”,
“variableB”: “Request submitted by the Role Access Management Tool”
}
],
“defaultStep”: “End Step — Success 2”,
“type”: “choice”
},
“End Step — Success 1”: {
“type”: “success”
},
“End Step — Success 2”: {
“type”: “success”
}
}
},
“description”: null,
“nextStep”: “End Step — Success”,
“type”: “action”,
“versionNumber”: 1
}
}
},
“creator”: {
“type”: “IDENTITY”,
“id”: “495aaxxxxxxxxxxxxxxxxxxxx”,
“name”: “hgxxxxx”
},
“trigger”: {
“type”: “SCHEDULED”,
“attributes”: {
“cronString”: “10 21 * * *”,
“frequency”: “cronSchedule”,
“timeZone”: “Asia/Calcutta”
}
}
}

Thanks,
Harish G