Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Issue with SNOW task creation for disconnected apps

asp
Regular Contributor
Regular Contributor

Hello,

We are on v2021 and use the Saviynt App for ServiceNow as a front end for requests. Approvals are in SNOW, and the fulfillment is in EIC. So all access requests are submitted/approved in SNOW, and their provisioning tasks created in EIC. Some of the access requests are for disconnected apps, so we create SNOW tasks (sc tasks) for their fulfillment.  We also have some birthright access that ends up creating SNOW tickets. In this case, there is no "request" behind the provisioning task. 

The issue we are facing is when we try to fetch the RITM associated with the request that has come from SNOW. THe below code does pick up the RITM from the SNOW request. However, the problem is with the birthright provisioning tasks (without request), it ends up creating SNOW tasks (tickets) with the json code.  If we take out the 'parent' and 'request_item' from the below list, the ticketsfor the birthright provisioning tasks (without requests) do get created correctly. 

{

               "call": [{

                              "name": "Access Level",

                              "connection": "acctAuth",

                              "url": https://<myservicenowinstance>/api/now/table/sc_task ,

                              "httpMethod": "POST",

                              "httpParams": "{\"short_description\":\"Request to Add Access in ${arsTasks?.endpoint?.displayName}\",\"description\":\"Below are the details\\\\nName                          : ${user.firstname} ${if(user.middlename!=null){user.middlename} else('')} ${user.lastname} \\\\nUsername                : ${user.customproperty17} \\\\nEmployeeID            : ${user.employeeid}  \\\\nUser Email               : ${if(user.email!=null){user.email} else('')}\\\\nJob Title                    : ${if(user.title!=null){user.title} else('')}\\\\nDepartment            : ${if(user.costcenter!=null){user.costcenter} else('')}\\\\nBuilding                     : ${if(user.locationnumber!=null){user.locationnumber} else('')}\\\\nEntitlement              : ${entitlementValue}\\\\nInstructions             : ${if(arsTasks.entitlement_valueKey.customproperty20!=null){org.apache.commons.lang.StringEscapeUtils.escapeJava(arsTasks.entitlement_valueKey.customproperty20)} else('')}\",\"assignment_group\":\"${arsTasks.entitlement_valueKey.customproperty19}\",\"parent\":\"${String finalVal = ''; ArrayList arr = new ArrayList(); arr.addAll(arsTasks?.requestKey?.request_access); arr.eachWithIndex{ val, idx -> val?.comments?.contains('RITM') ? finalVal = val?.comments?.substring(val?.comments?.indexOf(' - ') + 2, val?.comments?.toLowerCase().indexOf('created') - 2).trim() : '' }; return finalVal;}\",\"request_item\":\"${String finalVal = ''; ArrayList arr = new ArrayList(); arr.addAll(arsTasks?.requestKey?.request_access); arr.eachWithIndex{ val, idx -> val?.comments?.contains('RITM') ? finalVal = val?.comments?.substring(val?.comments?.indexOf(' - ') + 2, val?.comments?.toLowerCase().indexOf('created') - 2).trim() : '' }; return finalVal;}\"}",

                              "httpHeaders": {

                                             "Authorization": "${access_token}"

                              },

                              "httpContentType": "application/json",

                              "successResponses": {

                                             "statusCode": [200, 201, 204]

                              }

               }]

}

 

We have tried to add null checks in the 'parent' and 'request_item' parameters as such:

\"parent\":\"${ if(task.requestKey!=null) { String finalVal = ''; ArrayList arr = new ArrayList(); arr.addAll(arsTasks?.requestKey?.request_access); arr.eachWithIndex{ val, idx -> val?.comments?.contains('RITM') ? finalVal = val?.comments?.substring(val?.comments?.indexOf(' - ') + 2, val?.comments?.toLowerCase().indexOf('created') - 2).trim() : '' }; return finalVal;}  else {''} }\"

Thanks.

[This message has been edited by moderator to mask url]

1 REPLY 1

saikanumuri
Saviynt Employee
Saviynt Employee

Hi @asp 

Thanks for reaching out. 

This would require additional troubleshooting as the logs and the design for this integration need to be reviewed. I see there was also a support ticket raised for this issue and our support team will look into it further and share the next steps over the ticket.