Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

in service now do not need remove/disable account ticket

K_India
New Contributor III
New Contributor III

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
]
}
}]
}

5 REPLIES 5

rushikeshvartak
All-Star
All-Star


"connection": "${(task.tasktype == '30' || (task.tasktype == '2' && task?.entitlementValueKey == null)) ? '' : 'userAuth'}"

 

Condition 1: task.tasktype == '30'

  • If this condition is true, "connection" is set to an empty string (''), leaving it blank.

Condition 2: (task.tasktype == '2' && task?.entitlementValueKey == null)

  • If task.tasktype is 2 and task?.entitlementValueKey is null, "connection" is also set to '' (blank).

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


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

ticket error.png
When I use the json provided by you in above solution, it did not generate ticket number but task do not get completed

  • Does it works from postman ?

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

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. 

Share updated json with logs


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.