Hi All,
When I use $.hTTPRequest.body[*].attributes.displayName
in the “Send Email” action, I can see the displayName list in the sent mail. However, when I try to use the same in the HTTP action while raising a ticket in ServiceNow, like this: {{$.hTTPRequest.body[*].attributes.displayName}}
, I encounter the following error:
“Unable to parse input as JSON, please ensure it is syntactically correct. (type: Error Parsing Input, retryable: false): invalid character ‘\’ looking for beginning of object key string”
Complete w/f:
{
"name": "Search based workflow",
"description": "Search based workflows for the Entitlement and Account aggregation failure , Identity exception",
"modified": "2024-05-27T16:12:06.177904167Z",
"modifiedBy": {
"type": "IDENTITY",
"id": "2cxxxxxxxxxxxxxxxxxxxxx54",
"name": "vsxxxxx6"
},
"definition": {
"start": "HTTP Request",
"steps": {
"End Step - Success": {
"description": "Success",
"displayName": "",
"type": "success"
},
"HTTP Request": {
"actionId": "sp:http",
"attributes": {
"authenticationType": "OAuth",
"jsonRequestBody": {
"indices": [
"identities"
],
"query": {
"query": "processingState:ERROR"
}
},
"method": "post",
"oAuthClientId": "e9exxxxxxxxxxxxxxxxxxxx8b2",
"oAuthClientSecret": "$.secrets.127947xxxxxxxxxxxxxxxx0",
"oAuthCredentialLocation": "oAuthInHeader",
"oAuthTokenUrl": "https://cxxxxx4-dev.api.identitynow.com/oauth/token",
"requestContentType": "json",
"requestHeaders": {
"Accept": "application/json"
},
"url": "https://cxxxxx4-dev.api.identitynow.com/v3/search"
},
"displayName": "",
"nextStep": "Send Email",
"type": "action",
"versionNumber": 2
},
"HTTP Request 1": {
"actionId": "sp:http",
"attributes": {
"authenticationType": "OAuth",
"jsonRequestBody": "{\\\"assignment_group\\\":\\\"Access-Governance-L2\\\",\\\"business_service\\\":\\\"Identity Governance and Administration (IGA) Service\\\",\\\"caller_id\\\":\\\"abdxx20\\\",\\\"category\\\":\\\"software\\\",\\\"cmdb_ci\\\":\\\"SailPoint (Dev) IdentityNow\\\",\\\"contact_type\\\":\\\"Alert\\\",\\\"description\\\":\\\"There has been an error in Identity processing state {{$.hTTPRequest.body[*].attributes.displayName}}\\\",\\\"impact\\\":\\\"2 - medium\\\",\\\"short_description\\\":\\\"Please Ignore this incident, this is part of Sailpoint APIGEE Testing\\\",\\\"subcategory\\\":\\\"applications\\\",\\\"urgency\\\":\\\"2 - medium\\\",\\\"work_notes\\\":\\\"Auto Alerts Created for Failures\\\"}",
"method": "post",
"oAuthClientId": "tmxxxxxxxxxxxxxxxQT",
"oAuthClientSecret": "$.secrets.fxxxxxxxxxxxxxxxxxxxxa",
"oAuthCredentialLocation": "oAuthInBody",
"oAuthTokenUrl": "https://hoooo-api-dev.apigee.net/oauth/v2/client_credential/accesstoken",
"requestContentType": "json",
"requestHeaders": {
"x-apikey": "txxxxxxxxxxxxxxxxxx3QT"
},
"url": "https://hoooo-api-dev.apigee.net/eap-servicenow-mgmt/v1/servicenow/incidents"
},
"description": "Create Incident for the Failed Request",
"displayName": "",
"nextStep": "Send Email 1",
"type": "action",
"versionNumber": 2
},
"Send Email": {
"actionId": "sp:send-email",
"attributes": {
"body": "<p>Dear Team,</p>\n\n<p>We have detected Error in the identities. Below are the reports:</p>\n\n<h3>Identities in Error state</h3>\n<ul>\n <li>${name}</li>\n</ul>\n\n<p>Please investigate and take necessary actions to resolve these issues promptly.</p>\n\n<p>Best regards,</p>",
"context": {
"name.$": "$.hTTPRequest.body[*].attributes.displayName"
},
"recipientEmailList": [
"[email protected]"
],
"subject": "Identities with Error"
},
"displayName": "",
"nextStep": "HTTP Request 1",
"type": "action",
"versionNumber": 2
},
"Send Email 1": {
"actionId": "sp:send-email",
"attributes": {
"body": "Dear {{$.getIdentity.attributes.displayName}}, <br>\n\nPlease note that your recent SailPoint request has failed. We have automatically created a ticket on your behalf. The ticket number is {{$.hTTPRequest.body.result.number}}.<br>\n\nRegards,<br>\nSailPoint Service Team",
"context": {},
"recipientEmailList": [
"[email protected]"
]
},
"description": "get incident id",
"displayName": "",
"nextStep": "End Step - Success",
"type": "action",
"versionNumber": 2
}
}
},
"creator": {
"type": "IDENTITY",
"id": "4xxxxxxxxxxxxxxxxxxx1",
"name": "hxxxxx4"
},
"trigger": {
"type": "SCHEDULED",
"attributes": {
"cronString": "0 * * * *",
"frequency": "cronSchedule",
"timeZone": "Asia/Calcutta"
}
}
}
Please let me know if there is any findings!
Thanks,
HArish G