and more in a single search tool across platforms. Read the announcement here. |
02/13/2024 03:59 AM
ServiceNow create ticket json is not working , it was working before then based on some requirement i have added more attributes like user.employeetype, title, startdate, enddate etc. then its not working.
Please review and help me fixing it.
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://XXXX.service-now.com/api/agpl2/create_request",
"httpMethod": "POST",
"httpParams": "{\"opened_by\":\"${requestor}\",\"requested_for\":\"${user.username}\",\"assignment_group\":\"MW Identity & Access Mgmt\",\"short_description\":\"This request has been created from Saviynt Security Manager IAM system\",\"RequestID\":\"${if(task.requestKey!=null){task.requestKey?.processinstanceid?.substring(task.requestKey?.processinstanceid?.indexOf('.') + 1, task.requestKey?.processinstanceid?.length())}else if(task.requestKey==null){task.id}}\",\"description\":\"${if(task.tasktype==1 || task.tasktype==3){'Welcome our new team member ' +user.firstname+' ' +user.lastname +' who is scheduled to begin their journey as a ' +user.title +' with us.To ensure a seamless onboarding process we kindly request to perform if there is any prerequisite for this user.'}else if(task.tasktype==2 && (allEntitlementsValues==null || allEntitlementsValues.isEmpty() || allEntitlementsValues=='')){'Welcome our new team member ' +user.firstname+' ' +user.lastname +' who is scheduled to begin their journey as a ' +user.title +' with us.To ensure a seamless onboarding process we kindly request to perform if there is any prerequisite for this user.'}else if(task.tasktype==2 && task.source=='REQUEST'){'Welcome our new team member ' +user.firstname+' ' +user.lastname +' who is scheduled to begin their journey as a ' +user.title +' with us.To ensure a seamless onboarding process we kindly request to perform if there is any prerequisite for this user.'}else if (task.source=='CERTIFICATION' && task.tasktype==2){'This request is to remove access as part User Manager Certification for ' +user.firstname+' ' +user.lastname +' in ' +task.endpoint?.displayName +' application with access '+allEntitlementsValues}else {'Welcome our new team member ' +user.firstname+' ' +user.lastname +' who is scheduled to begin their journey as a ' +user.title +' with us.To ensure a seamless onboarding process we kindly request to perform if there is any prerequisite for this user.'}}\",\"application\":\"${task.endpoint?.displayName}\",\"RequestType\":\"${if(task.tasktype==1){'Add Access'}else if(task.tasktype==2){'Remove Access'}else if(task.tasktype==3){'Create Account'}else if (task.tasktype==8){'Remove Account'}}\",\"tasks\":\"${if(task.tasktype==1 || task.tasktype==3){'Welcome our new team member ' +user.firstname+' ' +user.lastname +' who is scheduled to begin their journey as a ' +user.title +' with us.To ensure a seamless onboarding process we kindly request to perform if there is any prerequisite for this user.'}else if(task.tasktype==2 && (allEntitlementsValues==null || allEntitlementsValues.isEmpty() || allEntitlementsValues=='')){'Welcome our new team member ' +user.firstname+' ' +user.lastname +' who is scheduled to begin their journey as a ' +user.title +' with us.To ensure a seamless onboarding process we kindly request to perform if there is any prerequisite for this user.'}else if(task.tasktype==2 && task.source=='REQUEST'){'Complete this request to remove access for ' +user.firstname+' ' +user.lastname +' in ' +task.endpoint?.displayName +' application with access '+allEntitlementsValues}else if (task.source=='CERTIFICATION' && task.tasktype==2){'This request is to remove access as part User Manager Certification for ' +user.firstname+' ' +user.lastname +' in ' +task.endpoint?.displayName +' application with access '+allEntitlementsValues}else {'Welcome our new team member ' +user.firstname+' ' +user.lastname +' who is scheduled to begin their journey as a ' +user.title +' with us.To ensure a seamless onboarding process we kindly request to perform if there is any prerequisite for this user.'}}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "result.RequestID",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}
02/13/2024 05:29 AM - edited 02/13/2024 05:30 AM
@Diptansu11 did you use below variables?
user.employeeType
user.title
user.startdate
user.enddate
Share the error logs
03/05/2024 10:48 PM
I have included below variables:
user.departmentName
user.title
user.startdate
user.employeeid
user.enddate
user.employeeType
user.location
user.email
user.customproperty4
kindly let me know if these are fine or not. As i am still facing the same error.
02/19/2024 06:00 PM
@Diptansu11 Is it resolved with suggested changes ?