Hi @gaurav_jain ,
The JSON string contains IdnAccessRequestAttributes in a string format and Workflows currently cannot convert String to JSON. Hence there are multiple combinations of steps required in the workflow to fetch the requestedObjectId
Below would be not one of the most elegant way to extract the requestedObjectId value but you can give it a try:
Assuming that your input is as above shared (copied in formatted string as below):
[
{
"_type": "event",
"_version": "v2",
"action": "RoleRemove",
"actor": {
"name": "test.user1"
},
"attributes": {
"accountName": "Test User",
"attributeName": "assignedRoles",
"attributeValue": "Test Okta [cloudRole-1694622119513]",
"flow": "appRequest",
"IdnAccessRequestAttributes": "{\"deniedCommentsRequired\":false,\"requestedObjectId\":\"785d141225f34ad7b330a5e188b70567\",\"accessRequestType\":\"REVOKE_ACCESS\",\"requestedObjectDescription\":\"Okta role\",\"requestedObjectName\":\"Test Okta\",\"requestedObjectType\":\"ROLE\"}",
"info": "Test Okta",
"interface": "LCM",
"operation": "RoleRemove",
"sourceName": "IIQ"
},
"created": "2023-09-13T17:14:50.102Z",
"id": "3e95ad4b24ab1283e32290bec6d124db0fc6f82460c7ec60331f589386c0aad0",
"name": "Remove Role Passed",
"objects": [
"ROLE"
],
"operation": "REMOVE",
"org": "testorg",
"pod": "testpod",
"stack": "wps",
"status": "PASSED",
"synced": "2023-09-13T17:14:50.432Z",
"target": {
"name": "Test User"
},
"technicalName": "ROLE_REMOVE_PASSED",
"trackingNumber": "0f97adc460334f34aa7ebe25c2467812",
"type": "ACCESS_ITEM"
}
]
- You can first define a variable in the workflow to get the index of
requestedObjectId in the value fetched for$.attributes.IdnAccessRequestAttributes :
- As the next step, you can define another variable and use this index from the preceding
Define Variable to get the requestId value like below:
Your workflow would have these two steps added where the second Define Variable : requestId has the value 785d141225f34ad7b330a5e188b70567. You can use it as $.defineVariable.requestId in the subsequent steps
I hope this helps your case.
Thanks,
Shailee