Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/28/2024 10:03 PM - last edited on 05/28/2024 10:57 PM by Sunil
Hi experts,
Need help finding the target field for feeding into createTicketJSON.
Currently, ${businessJustification} is used, but it may lack context. I'd like to include any additional comments, including manager approval comments etc. added in during the provisioning process.
I've seen the comments column in ars_requests stores this, but unsure how to parse into JSON. Any tips? Thanks in advance!
for context, current createTicketJSON:
{
"call": [{
"name": "createTicket",
"connection": "acctAuth",
"url": (redacted),
"httpMethod": "POST",
"httpContentType": "application/json",
"httpParams": "{\"serviceDeskId\": \"20\",\"requestTypeId\": \"266\",\"requestFieldValues\": {\"summary\":\"${endpoint.endpointname} Request\",\"description\": \"Email: ${user.email}\\\\n Entitlements:\\\\n ${allEntitlementsValues}\\\\n Endpoint: ${endpoint.endpointname}\\\\n Business Justification: ${businessJustification}\"}}",
"ticketidPath": "issueKey",
"httpHeaders": {
"Authorization": "${access_token}"
}
}
]
}
Xu
[This message has been edited by moderator to merge reply comment]
05/30/2024 07:41 AM - edited 05/30/2024 07:41 AM
Hi @xu ,
Can you try the below:
\\\\nBusiness Justification : '+(task.requestKey==null?'':task.requestKey?.comments?.replaceAll('<.*?>','').replaceAll('\\n','').replaceAll('\\r','').replaceAll('[^ -~À-ÿ]+','').replaceAll(new String('XFw='.decodeBase64()),new String('XFxcXA=='.decodeBase64())))
If this helps, please consider selecting Accept As Solution and hit Kudos
05/31/2024 12:21 AM
Hi Prem,
Thanks for your response - unfortunately this has now broken the Jira ticket generation, and Saviynt provides this error
The logs seem to show the payloads suddenly cut off:
2024-05-31T17:04:20+10:00-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-7-tk5s9-ERROR
-Error in createNewServiceTicketcom.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value at [Source: {"serviceDeskId": "20","requestTypeId": "266","requestFieldValues": {"summary":"DEV TICKET - parse comments - IRESS Request","description": "Saviynt User ID: lfan\n Saviynt Request ID: 610605\n Email: lucina.fan-v@barrenjoey.com\n \n Entitlements:\n ADD :: Group : (BASIC+ADMIN (Test))\n Endpoint: IRESS\nBusiness Justification : '+(task.requestKey==null?'':task.requestKey?.comments?.replaceAll('<.*?>','').replaceAll('
CreateTicketJSON for reference:
"httpParams": "{\"serviceDeskId\": \"20\",\"requestTypeId\": \"266\",\"requestFieldValues\": {\"summary\":\"DEV TICKET - parse comments - ${endpoint.endpointname} Request\",\"description\": \"Saviynt User ID: ${user.username}\\\\n Saviynt Request ID: ${requestid}\\\\n Email: ${user.email}\\\\n \\\\n Entitlements:\\\\n ${allEntitlementsValues}\\\\n Endpoint: ${endpoint.endpointname}\\\\nBusiness Justification : '+(task.requestKey==null?'':task.requestKey?.comments?.replaceAll('<.*?>','').replaceAll('\\n','').replaceAll('\\r','').replaceAll('[^ -~À-ÿ]+','').replaceAll(new String('XFw='.decodeBase64()),new String('XFxcXA=='.decodeBase64())))",
06/02/2024 05:03 AM
@xu try below
{
"httpParams": "{\"serviceDeskId\": \"20\",\"requestTypeId\": \"266\",\"requestFieldValues\": {\"summary\":\"DEV TICKET - parse comments - ${endpoint.endpointname} Request\",\"description\": \"Saviynt User ID: ${user.username}\\n Saviynt Request ID: ${requestid}\\n Email: ${user.email}\\n \\n Entitlements:\\n ${allEntitlementsValues}\\n Endpoint: ${endpoint.endpointname}\\nBusiness Justification : \"+(task.requestKey==null?\'\':task.requestKey?.comments?.replaceAll('<.*?>','').replaceAll('\\n','').replaceAll('\\r','').replaceAll('[^ -~À-ÿ]+','').replaceAll(new String('XFw='.decodeBase64()),new String('XFxcXA=='.decodeBase64())))\"}"
06/02/2024 11:57 PM
Hi Raghu,
Thank you and Prem kindly for your responses, it helped me to find @Darshanjain's answer on https://forums.saviynt.com/t5/identity-governance/passing-the-comments-and-justifications-as-an-attr... with this format:
${task.requestKey==null?'':task.requestKey?.comments?.replaceAll('<.*?>','').replaceAll('\\n','').replaceAll('\\r','').replaceAll('[^ -~À-ÿ]+','').replaceAll(new String('XFw='.decodeBase64()),new String('XFxcXA=='.decodeBase64()))}
For some reason, the other format without the ${} was running into errors.