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

Task Source and Task Type in HttpParams

Saviynt_Savvy
Regular Contributor
Regular Contributor

Hi,
I am working on Freshservice Ticketing System.
I have a use case where the "Ticket Subject" is based on the "Task Type" and "Task Source".

Condition:
If task.type=Add Access and task.source=ZERODAY, then Ticket Subject="Onboard Ticket".
If task.type=Add Access and task.source=REQUEST, then Ticket Subject="ARS Ticket".

I am using the below condition in the "httpParams" of the Create Ticket JSON to check the above conditions:
CREATETICKETJSON:
{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xxxxxxxxx.freshservice.com/api/v2/tickets",
"httpMethod": "POST",
"httpParams": "{\"subject\":\"${task.type==1 && task.source=='ZERODAY'?'Onboard Ticket : '+task.endpoint.customproperty7+'-' +user.username+'-'+user.startdate.format(\"MMMM dd yyyy\"): task.tasktype==1 && task.source=='REQUEST'?'Add Access Ticket : '+task.endpoint.customproperty9+'-' +user.username+'-'+task.taskdate.format(\"MMMM dd yyyy\"):''}\",\"email\":\"johnjacob@insta.com\",\"description\": \"<div><strong>Name : </strong>${task.accountName}</div></div><div><strong>Department :</strong>${user.departmentname}</div><div><strong>Email :</strong> ${user.customproperty5}</div><div><strong>Endpoint :</strong> ${task.endpoint}</div><div><strong>${'Requested Entilements :':''}</strong> ${allEntitlementsValues.replace('ADD :: ','').replace('\n','').replace('(','').replace(')',''):''}</div>\",\"priority\": 1, \"status\": 2}",
"httpHeaders": {
"contentType": "application/json",
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "ticket.id",
"unsuccessResponses": {
"message": "Failed"
}
}
]
}
I have mentioned the condition like in the above JSON and ran the Job, but the task is not provisioned.
How can I check the above conditions in the JSON?

Thanks & Regards,
Saviynt Savvy

1 REPLY 1

rushikeshvartak
All-Star
All-Star

{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xxxxxxxxx.freshservice.com/api/v2/tickets",
"httpMethod": "POST",
"httpParams": "{\"subject\":\"${task.type==1 && task.source=='ZERODAY' ? 'Onboard Ticket : ' + task.endpoint.customproperty7 + '-' + user.username + '-' + user.startdate.format(\\\"MMMM dd yyyy\\\") : task.type==1 && task.source=='REQUEST' ? 'Add Access Ticket : ' + task.endpoint.customproperty9 + '-' + user.username + '-' + task.taskdate.format(\\\"MMMM dd yyyy\\\") : ''}\",\"email\":\"sumanth.royal@ss.com\",\"description\":\"<div><strong>Name : </strong>${task.accountName}</div></div><div><strong>Department :</strong>${user.departmentname}</div><div><strong>Email :</strong> ${user.customproperty5}</div><div><strong>Endpoint :</strong> ${task.endpoint}</div><div><strong>${'Requested Entilements :':''}</strong> ${allEntitlementsValues.replace('ADD :: ','').replace('\\n','').replace('(','').replace(')',''):''}</div>\",\"priority\": 1, \"status\": 2}",
"httpHeaders": {
"contentType": "application/json",
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "ticket.id",
"unsuccessResponses": {
"message": "Failed"
}
}
]
}


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