Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/14/2024 04:59 PM
Hi
I am using below JSON for createTicket in REST connection, I do not need remove/disable account ticket to be created in ServiceNOW all other ticket is fine to create. So for remove/disable account task should be provisioned without service now intervention. Is it possible? appreciate any solution or suggestion
{
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://stage.api.xxx.com/digital/servicenowqa/v1/sc_request",
"httpMethod": "POST",
"httpParams": "{\"insert\": {\"partnerInfo\": {\"name\": \"com.xxxxxx.itr.idm\",\"externalRecord\": \"11072023\"},\"item\":\"General Service Request\",\"itemVariables\": {\"v_requested_for\": \"${requestor.username}\",\"v_configuration_item\":\"${endpoint.customproperty1}\",\"assignment_group\": \"{endpoint.customproperty2}\",\"v_short_description\":\"${if(task.tasktype == 2) { 'REMOVE';} else {'ADD';}} ${endpoint.endpointname} user for ${user.username} \",\"v_detailed_description\":\"Request id : ${requestid} \\\\nApplication Name : ${endpoint.endpointname}\\\\n \\\\nAction : \\\\nRequest Type : ${if(task.tasktype == 2) {'REMOVE';} else {'ADD';}} \\\\nRequested By : ${requestor.firstname},${requestor.lastname} (${requestor.username}) \\\\nRequested for : ${user.firstname},${user.lastname}(${user.username})\\\\nEntitlements :\\\\n${allEntitlementsValues}\\\\nAddtional information :${reqAttrs.customproperty32} ,${reqAttrs.customproperty31} \\\\n \\\\nRequestor comments :\\\\n${task.requestKey==null?'':task.requestKey?.comments?.replaceAll('<.*?>','').replaceAll('\\n','').replaceAll('\\r','').replaceAll('[^ -~À-ÿ]+','').replaceAll(new String('XFw='.decodeBase64()),new String('XFxcXA=='.decodeBase64()))} \\\\n \\\\nApprovers: ${approvers} \\\\nApprover comments : \\\\n\\\\nSaviynt Taskid : ${taskIds} \\\\n \"}}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "result.number",
"ticketStatusPath": "result.state",
"ticketStatusValue": [
"Open",
"OPEN",
"open",
"Assigned"
],
"unsuccessResponses": {
"message": "Failed to create the ticket"
},
"successResponses": {
"statusCode": [
200,
201
]
}
}]
}
08/14/2024 05:17 PM - edited 08/14/2024 05:20 PM
"connection": "${(task.tasktype == '30' || (task.tasktype == '2' && task?.entitlementValueKey == null)) ? '' : 'userAuth'}"
Condition 1: task.tasktype == '30'
Condition 2: (task.tasktype == '2' && task?.entitlementValueKey == null)
Else: If neither condition is true, "connection" is set to 'userAuth'.
Task type 30 = Disable Account Task
Task type 2 & without entitlement value is remove account
08/30/2024 02:41 PM
When I use the json provided by you in above solution, it did not generate ticket number but task do not get completed
08/30/2024 04:11 PM
08/30/2024 04:58 PM
No, It is from ARS only. I have removed account for the application from request access from others page then it generated the task. And i run the job to complete the tas but it gives this comments. however for add access and other things it successfully generates (works as expected) the ticket number and after ticket get closed here task also get completed.
08/30/2024 05:03 PM
Share updated json with logs