Workflow to bypass access request approval

Hi,

I have build below workflow to bypass the access request approval based on the access request comment. Workflow is failing. If anyone finds the issue in the below JSON workflow please let me know.

{
	"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

Hi Harish.

Please provide the log of the execution that failed, along with a screenshot of the error message. Please make sure you review the log and remove any sensitive information before posting it here.

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