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 in Create Ticket Json

AtrayeeDutta
Regular Contributor
Regular Contributor

Hi Team,

While creating ticket for some disconnected Application, using below JSON:

"httpParams": "{\"opened_by\":\"${requestor}\",\"requested_for\":\"$user.username\",\"assignment_group\":\"Application Support\",\"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){'Complete this request to create account for ' +user.firstname+' ' +user.lastname +' in ' +task.endpoint?.displayName +' application along with access '+allEntitlementsValues}else if(task.tasktype==2 && (allEntitlementsValues==null || allEntitlementsValues.isEmpty() || allEntitlementsValues=='')){'Complete this request to remove account for ' +user.firstname+' ' +user.lastname +' in ' +task.endpoint?.displayName +' application as all accesses removed'}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 {'Complete this request to remove account for ' +user.firstname+' ' +user.lastname +' in ' +task.endpoint?.displayName +' application along with access '+allEntitlementsValues}}\",\"application\":\"${task.endpoint?.displayName}\"}"

 

It is not populating the requested_for and opened_by attributes:

AtrayeeDutta_0-1709034385840.png

Over postman it is showing like this for opened_by and requested_for with a link:

AtrayeeDutta_1-1709034450380.png

How can we resolve the issue?

Regards

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

5 REPLIES 5

adriencosson
Valued Contributor
Valued Contributor

Hello @AtrayeeDutta ,

The "Requested for" and "Opened by" attribute in ServiceNow are a reference object to a user in "sys_user" table.

Therefore you need to pass the sys_id of the same user you want to create the request for.

Hope this helps.

 

Regards,
Adrien COSSON

AtrayeeDutta
Regular Contributor
Regular Contributor

Hi Team,

How can we pass that from Saviynt from create ticket json? requestor and requested user username are present in the arstasks only right.

Regards

Regards

try below 

"httpParams": "{\"requested_for\":\"${user?.email}\",\"short_description\":\"Saviynt Request ${if(task.requestKey!=null){task.requestKey?.processinstanceid?.substring(task.requestKey?.processinstanceid?.indexOf('.') + 1, task.requestKey?.processinstanceid?.length())}else if(task.requestKey==null){task.id}} – ${if(task.tasktype==1){'Add Entitlement'} else if(task.tasktype== 2){'Remove Entitlement'}} – Requested for $user.displayname ($user.username)\",\"description\":\"Saviynt Request ${if(task.requestKey!=null){task.requestKey?.processinstanceid?.substring(task.requestKey?.processinstanceid?.indexOf('.') + 1, task.requestKey?.processinstanceid?.length())}else if(task.requestKey==null){task.id}} – ${if(task.tasktype==1){'Add Entitlement'} else if(task.tasktype== 2){'Remove Entitlement'}} – Requested for $user.displayname ($user.username) for $task.endpoint.displayName \",\"task_details\":[{\"short_description\":\"Saviynt Request ${if(task.requestKey!=null){task.requestKey?.processinstanceid?.substring(task.requestKey?.processinstanceid?.indexOf('.') + 1, task.requestKey?.processinstanceid?.length())}else if(task.requestKey==null){task.id}} – ${if(task.tasktype==1){'Add Entitlement'} else if(task.tasktype== 2){'Remove Entitlement'}} – for $user.displayname ($user.username - $user.locationdesc) for $task.endpoint.displayName\",\"description\":\"${allEntitlementsValues}\", \"assignment_group\":\"Help Desk\"}]}",

Make sure email match with service now and saviynt


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

Manu269
All-Star
All-Star

@AtrayeeDutta we are using this and it works :

,\"requested_for\":\"${user.email}\",\"opened_by\":\"${if(task.requestKey!=null){com.saviynt.ecm.identitywarehouse.domain.Users.get(task?.requestedBy).email}else{''}}\"

 

Also as mentioned make sure the email is same across SNOw and Saviynt

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

AtrayeeDutta
Regular Contributor
Regular Contributor

Thank you Team, it worked.