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

Servicenow Ticket Creation Bypass the ticketcreation for ARS task

ankitalande
New Contributor II
New Contributor II

Hii,

I want the implement the use case if request is raise from ARS then bypass the ticketcreation process and if request is raise through birthright rule or user update rule then only ritm will be generate,

Kindly suggest the sample json.

Currently I use the following rest snow api for this. But It not take else part, if task generate through rule it also not craete ritm getting error in craete ritm.

{
"ticketidPath": "call2.message.result.number",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://testdev.service-now.com/api/now/v1/table/sc_request",
"httpMethod": "POST",
"httpParams": "${if(task.requestKey!=null){\"opened_by\":\"\",\"requested_for\":\"\",\"assignment_group\":\"\",\"description\":\"\"}else if(task.source=='ZERODAY'||task.source=='PROVRULE'){\"opened_by\":\"svc_syt01dev\",\"cat_item\":\"${if(task.source=='PROVRULE'){ 'IT Security Provisioning Rule' }else{'IT Security Birthright Access'}}\",\"u_subcategory\":\"Identity Management\",\"u_subcategory\":\"Access Request\",\"request\":\"${response.call1.message.result.number}\",\"requested_for\":\"${user.firstname} ${user.lastname}\",\"assignment_group\":\"IAM\",\"due_date\":\"2024-01-26 00:03:15\",\"approval\":\"approved\",\"description\":\"Saviynt Task ID: ${task}\\\\r\\\\nTask type: ${if(task.tasktype==1){'Add Access'}else if(task.tasktype==2 && (allEntitlementsValues==null||allEntitlementsValues.isEmpty()||allEntitlementsValues=='')){'Delete Account'}else if(task.tasktype==2){'Remove Access'}else if(task.tasktype==3){'New Account'}else if(task.tasktype==6){'Enable Account'}else if(task.tasktype==14){'Disable Account'}else if(task.tasktype==12){'Update Account'}else if(task.tasktype==32){'Lock Account'}else if(task.tasktype==33){'Unlock Account'}else{task.tasktype}}\\\\r\\\\nUser Firstname: ${user.firstname}\\\\r\\\\nUser Lastname: ${user.lastname}\\\\r\\\\nAccount: ${task.accountName}\\\\r\\\\nApplication Name: ${endpoint}${if(allEntitlementsValues==null||allEntitlementsValues.isEmpty()||allEntitlementsValues==''){''}else{'\\\\r\\\\nAccount Entitlements: '+ allEntitlementsValues}}\"}else{\"opened_by\":\"svc_syt01dev\",\"cat_item\":\"IT Security Birthright Access\",\"u_subcategory\":\"Identity Management\",\"u_subcategory\":\"Access Request\",\"request\":\"${response.call1.message.result.number}\",\"requested_for\":\"${user.firstname} ${user.lastname}\",\"assignment_group\":\"${if(task.endpoint?.customproperty1 == 'LearningandDevelopment'){ 'Learning and Development' }else if(task.endpoint?.customproperty1 == 'ITServiceDesk'){ 'IT Service Desk' }else if(task.endpoint?.customproperty1 == 'FieldServices'){ 'Field Services' }else if(task.endpoint?.customproperty1 == 'PhysicalSecurity'){ 'Physical Security' }else{ 'IAM' }}\",\"due_date\":\"2024-01-26 00:03:15\",\"approval\":\"approved\",\"description\":\"Saviynt Task ID: ${task}\\\\r\\\\nTask type: ${if(task.tasktype==1){'Add Access'}else if(task.tasktype==2 && (allEntitlementsValues==null||allEntitlementsValues.isEmpty()||allEntitlementsValues=='')){'Delete Account'}else if(task.tasktype==2){'Remove Access'}else if(task.tasktype==3){'New Account'}else if(task.tasktype==6){'Enable Account'}else if(task.tasktype==14){'Disable Account'}else if(task.tasktype==12){'Update Account'}else if(task.tasktype==32){'Lock Account'}else if(task.tasktype==33){'Unlock Account'}else{task.tasktype}}\\\\r\\\\nUser Firstname: ${user.firstname}\\\\r\\\\nUser Lastname: ${user.lastname}\\\\r\\\\nAccount: ${task.accountName}\\\\r\\\\nApplication Name: ${endpoint}${if(allEntitlementsValues==null||allEntitlementsValues.isEmpty()||allEntitlementsValues==''){''}else{'\\\\r\\\\nAccount Entitlements: '+ allEntitlementsValues}}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
},
{
"name": "call2",
"connection": "acctAuth",
"url": "https://testdev.service-now.com/api/now/v1/table/sc_req_item",
"httpMethod": "POST",
"httpParams": "${if(task.requestKey!=null){\"opened_by\":\"\",\"requested_for\":\"\",\"assignment_group\":\"\",\"description\":\"\"}else if(task.source=='ZERODAY'||task.source=='PROVRULE'){\"opened_by\":\"svc_syt01dev\",\"cat_item\":\"${if(task.source=='PROVRULE'){ 'IT Security Provisioning Rule' }else{'IT Security Birthright Access'}}\",\"u_subcategory\":\"Identity Management\",\"u_subcategory\":\"Access Request\",\"request\":\"${response.call1.message.result.number}\",\"requested_for\":\"${user.firstname} ${user.lastname}\",\"assignment_group\":\"IAM\",\"due_date\":\"2024-01-26 00:03:15\",\"approval\":\"approved\",\"description\":\"Saviynt Task ID: ${task}\\\\r\\\\nTask type: ${if(task.tasktype==1){'Add Access'}else if(task.tasktype==2 && (allEntitlementsValues==null||allEntitlementsValues.isEmpty()||allEntitlementsValues=='')){'Delete Account'}else if(task.tasktype==2){'Remove Access'}else if(task.tasktype==3){'New Account'}else if(task.tasktype==6){'Enable Account'}else if(task.tasktype==14){'Disable Account'}else if(task.tasktype==12){'Update Account'}else if(task.tasktype==32){'Lock Account'}else if(task.tasktype==33){'Unlock Account'}else{task.tasktype}}\\\\r\\\\nUser Firstname: ${user.firstname}\\\\r\\\\nUser Lastname: ${user.lastname}\\\\r\\\\nAccount: ${task.accountName}\\\\r\\\\nApplication Name: ${endpoint}${if(allEntitlementsValues==null||allEntitlementsValues.isEmpty()||allEntitlementsValues==''){''}else{'\\\\r\\\\nAccount Entitlements: '+ allEntitlementsValues}}\"}else{\"opened_by\":\"svc_syt01dev\",\"cat_item\":\"IT Security Birthright Access\",\"u_subcategory\":\"Identity Management\",\"u_subcategory\":\"Access Request\",\"request\":\"${response.call1.message.result.number}\",\"requested_for\":\"${user.firstname} ${user.lastname}\",\"assignment_group\":\"${if(task.endpoint?.customproperty1 == 'LearningandDevelopment'){ 'Learning and Development' }else if(task.endpoint?.customproperty1 == 'ITServiceDesk'){ 'IT Service Desk' }else if(task.endpoint?.customproperty1 == 'FieldServices'){ 'Field Services' }else if(task.endpoint?.customproperty1 == 'PhysicalSecurity'){ 'Physical Security' }else{ 'IAM' }}\",\"due_date\":\"2024-01-26 00:03:15\",\"approval\":\"approved\",\"description\":\"Saviynt Task ID: ${task}\\\\r\\\\nTask type: ${if(task.tasktype==1){'Add Access'}else if(task.tasktype==2 && (allEntitlementsValues==null||allEntitlementsValues.isEmpty()||allEntitlementsValues=='')){'Delete Account'}else if(task.tasktype==2){'Remove Access'}else if(task.tasktype==3){'New Account'}else if(task.tasktype==6){'Enable Account'}else if(task.tasktype==14){'Disable Account'}else if(task.tasktype==12){'Update Account'}else if(task.tasktype==32){'Lock Account'}else if(task.tasktype==33){'Unlock Account'}else{task.tasktype}}\\\\r\\\\nUser Firstname: ${user.firstname}\\\\r\\\\nUser Lastname: ${user.lastname}\\\\r\\\\nAccount: ${task.accountName}\\\\r\\\\nApplication Name: ${endpoint}${if(allEntitlementsValues==null||allEntitlementsValues.isEmpty()||allEntitlementsValues==''){''}else{'\\\\r\\\\nAccount Entitlements: '+ allEntitlementsValues}}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}

 

Suggest the sample json for this How we can achieve this.

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

Use callCondition

"callCondition": "${arstasksObj?.source == 'REQUEST'}",

rushikeshvartak_0-1710819621049.png

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Still not working. 

 

23.1 then 

"callCondition": "${tasks?.source == 'REQUEST'}",

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

ankitalande
New Contributor II
New Contributor II

"callCondition": "${arstasksObj?.source == 'REQUEST'}",  this syntax is working, 

"callCondition": "${arstasksObj?.source == 'ZERODAY'}", this condition is not working 

I want,

if "callCondition": "${arstasksObj?.source == 'ZERODAY'}", then create ritm and 

"callCondition": "${arstasksObj?.source == 'REQUEST'}", then ritm should not be create.

"callCondition": "${arstasksObj?.source != 'REQUEST'}",


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.