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

Getting error while passing description to ITSM system

biswajitoram
New Contributor III
New Contributor III

Hi Team,

We trying to implement a ServiceNow/ITSM connection with the  Saviynt. We are having some issues while passing the ticket description in CreateTicketJSON. It passes the code value while filtering the tasktype in the condition.

Expectation: Subject will be Access Card : CREATE - [UserDisplayName] [TaskAccountName] if tasktype==3

Sample: 

biswajitoram_0-1713510284092.png

"httpParams": "{\"values\": {\"First_Name\": \"Lotus\",\"Last_Name\": \"Integration User\",\"Description\": \"{if(task.tasktype==3){${endpoint.customproperty6} : ${endpoint.customproperty7} - ${user.displayname} ${task.accountName}}}\",\"Detailed_Description\": \"This is Service Ticket\",\"Affected_Current_Site\": \"Head Office\",\"Assigned Support Company\": \"Lotus's\",\"Assigned Support Organization\": \"EUC\",\"Assigned Group\": \"THL3 IT Security Identity Mgmt\",\"Impact\": \"3000\",\"Urgency\": \"3000\",\"Reported Source\": \"API\",\"Service_Type\": \"Service\",\"Product Categorization Tier 1\": \"Hardware Software Services\",\"Product Categorization Tier 2\": \"Microsoft Application\",\"Product Categorization Tier 3\": \"Microsoft Outlook - Calendar\"}}",

I have tried to add the $ before if condition but it passes as below

\"Description\": \"${if(task.tasktype==3){${endpoint.customproperty6} : ${endpoint.customproperty7} - ${user.displayname} ${task.accountName}}}\",

biswajitoram_1-1713511383151.png

Need your assistance to resolve it.

 

13 REPLIES 13

rushikeshvartak
All-Star
All-Star

Please share full json. You are using one of the unsupported variable


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

biswajitoram
New Contributor III
New Contributor III

Hi @rushikeshvartak 

PFA the full CreateTicketJSON

{
"call": [
{
"name": "call1",
"connection": "ITSMAuth",
"showResponse": true,
"url": "https://abc.xyz.com/api/v2/ticket",
"httpMethod": "POST",
"httpParams": "{\"values\": {\"First_Name\": \"Lotus\",\"Last_Name\": \"Integration User\",\"Description\": \"{if(task.tasktype==3){${endpoint.customproperty6} : ${endpoint.customproperty7} - ${user.displayname} ${task.accountName}}}\",\"Detailed_Description\": \"This is Service Ticket\",\"Affected_Current_Site\": \"Head Office\",\"Assigned Support Company\": \"Lotus's\",\"Assigned Support Organization\": \"EUC\",\"Assigned Group\": \"THL3 IT Security Identity Mgmt\",\"Impact\": \"3000\",\"Urgency\": \"3000\",\"Reported Source\": \"API\",\"Service_Type\": \"Service\",\"Product Categorization Tier 1\": \"Hardware Software Services\",\"Product Categorization Tier 2\": \"Microsoft Application\",\"Product Categorization Tier 3\": \"Microsoft Outlook - Calendar\"}}",
"httpHeaders": {
"Authorization": "${access_token}",
"contentType": "application/json"
},
"httpContentType": "application/json",
"ticketidPath": "values.Incident Number",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}

And how can I know which attributes are not supported in SV?

Please help me with this.

you can find variable exposed in below link

https://docs.saviyntcloud.com/bundle/EIC-Connectors/page/Content/Binding-Variables-for-Provisioning-...


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

Refer a sample :

{\"short_description\":\"${if(task.source=='PROVRULE' && task?.tasktype==14){'[NO ACTION REQUIRED]:'} else if(task.tasktype==14){'[NO ACTION REQUIRED]:'} else if(task.requestKey?.requesttype==3 || task.requestKey?.requesttype==11 && task.tasktype==3){''}else if(task.tasktype==2 && (allEntitlementsValues==null || allEntitlementsValues.isEmpty() || allEntitlementsValues=='')){''}else if(task.source=='PROVRULE' && task?.tasktype==2){''}else if(task.tasktype==2){''}else if(task.requestKey?.requesttype != 3 && task?.tasktype==1){''}else if(task.tasktype==6){''}else if(task.tasktype==12){''}else{task.tasktype}} Implementation: ${if(task.requestKey?.requesttype==3 || task.requestKey?.requesttype==11 && task.tasktype==3){'New Account and Grant Access'}else if(task.tasktype==2 && (allEntitlementsValues==null || allEntitlementsValues.isEmpty() || allEntitlementsValues=='')){'Delete Account'}else if(task.source=='PROVRULE' && task?.tasktype==2){'Revoke Access'}else if(task.tasktype==2){'Revoke Access'}else if(task.requestKey?.requesttype != 3 && task?.tasktype==1){'Grant Access'}else if(task.tasktype==6){'Enable Account'}else if(task.tasktype==12){'Update Account'}else if(task.source=='PROVRULE' && task?.tasktype==14){'Disable Account'} else if(task.tasktype==14){'Disable Account'}else{task.tasktype}} for ${user.displayname}
Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

biswajitoram
New Contributor III
New Contributor III

Hi @rushikeshvartak 

As per your suggestion, I have verified the JSON but didn't find any issue with the query.

Could you please help me with the unsupported variable that I am using?

Does hardcoded JSON works ?


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

biswajitoram
New Contributor III
New Contributor III

Hi @Manu269 

Thanks for your support it helped me a lot. I have successfully implemented the JSON and it is working as expected.  

I need some more help on this. I am unable to pass the user details in a listing manner. But unable to get with \\n . And date format as MM-DD-YYYY (no need to have a timestamp)

Expectation

biswajitoram_0-1714127099606.png

PFA the full JSON

{
"call": [
{
"name": "call1",
"connection": "ITSMHWAuth",
"showResponse": true,
"url": "https://abc.xyz.com/api/v2/ticket",
"httpMethod": "POST",
"httpParams": "{\"values\": {\"First_Name\": \"Lotus\",\"Last_Name\": \"Integration User\",\"Description\": \"${if(task?.tasktype==3){' New Joiner HW - '+user.displayname+' - '+task.accountName+' '} else if(task.tasktype==14){' TERMINATED HW - '+user.displayname+' - '+task.accountName+' '} }\",\"Detailed_Decription\": \" ${if(task?.tasktype==3){' Request Type: Laptop Setup \\n StartDate: '+user.startdate+' '} else if(task.tasktype==14){' TERMINATED HW - '+user.displayname+' - '+task.accountName+' '} }\",\"Affected_Current_Site\": \"Head Office\",\"Assigned Support Company\": \"Lotus's\",\"Assigned Support Organization\": \"EUC\",\"Assigned Group\": \"THL3 IT Security Identity Mgmt\",\"Impact\": \"4000\",\"Urgency\": \"4000\",\"Reported Source\": \"API\",\"Service_Type\": \"Service\",\"Product Categorization Tier 1\": \"Hardware Software Services\",\"Product Categorization Tier 2\": \"Microsoft Application\",\"Product Categorization Tier 3\": \"Microsoft Outlook - Calendar\"}}",
"httpHeaders": {
"Authorization": "${access_token}",
"contentType": "application/json"
},
"httpContentType": "application/json",
"ticketidPath": "values.Incident Number",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}

OUTPUT:

biswajitoram_1-1714127587411.png

 

Please help me with this 

You need new line ?


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

Hi @rushikeshvartak 

Yes, I need the next value in new line.

use \\\\n


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

Hi @rushikeshvartak 

Thanks for your support. I have used '\\\\n' and could able to get the result in new line.

biswajitoram
New Contributor III
New Contributor III

Hi @rushikeshvartak @Manu269 

I am facing issues while populating a few attributes mentioned below over the ITSM from the Saviynt side. 

Job Title: [JobDescription]
Department: [DepartmentName]
Work Level: [CustomProperty3]
Line Manager Name: [Owner DisplayName]
Line Manager Email: [Owner Email]
Location: [Location]

PFA the full JSON.


{
"call": [
{
"name": "call1",
"connection": "ITSMHWAuth",
"showResponse": true,
"url": "https://itservicedesk.lotuss.com/api/v2/ticket",
"httpMethod": "POST",
"httpParams": {
"values": {
"First_Name": "Lotus",
"Last_Name": "Integration User",
"Description": "${if(task?.tasktype==3){' New Joiner HW - '+user.displayname+' - '+task.accountName+' '} else if(task.tasktype==14){' TERMINATED HW - '+user.displayname+' - '+task.accountName+' '} }",
"Detailed_Decription": "${if(task?.tasktype==3){'Request Type: Laptop Setup \\\\n Start Date: '+user.startdate+' \\\\n End Date: '+user.enddate+' \\\\n Employee Name: '+user.displayname+' \\\\n Employee ID: '+user.employeeid+' \\\\n Email Address: '+user.email+' \\\\n Employee Type: '+user.employeeType+' \\\\n Job Title: '+user.jobdescription+' \\\\n Department: '+user.departmentname+' \\\\n Work Level: '+user.customproperty3+' \\\\n Line Manager Name: '+user.owner.displayname+' \\\\n Line Manager Email: '+user.owner.email+' \\\\n Location: '+user.location+' '} else if(task.tasktype==14){' TERMINATED HW - '+user.displayname+' - '+task.accountName+' '} }",
"Affected_Current_Site": "Head Office",
"Assigned Support Company": "Lotus's",
"Assigned Support Organization": "EUC",
"Assigned Group": "THL3 IT Security Identity Mgmt",
"Impact": "4000",
"Urgency": "4000",
"Reported Source": "API",
"Service_Type": "Service",
"Product Categorization Tier 1": "Hardware Software Services",
"Product Categorization Tier 2": "Microsoft Application",
"Product Categorization Tier 3": "Microsoft Outlook - Calendar"
}
},
"httpHeaders": {
"Authorization": "${access_token}",
"contentType": "application/json"
},
"httpContentType": "application/json",
"ticketidPath": "values.Incident Number",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}

Could you please help me with this?

 

Please create new thread


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