Click HERE to see how Saviynt Intelligence is transforming the industry. |
06/06/2023 12:13 PM
I am looking to create a request in ServiceNow and after running WSRETRY provisioning job for a task in Saviynt. I do not want that task to process and complete until the ServiceNow request is closed. Currently I can create a simple request after running WSRETRY provisioning job using the CreateTicketJSON. However, my task gets automatically marked as completed even when the ServiceNow request is still open. I believe my TicketStatusJSON is not working properly. I will add my TicketStatus & CreateTicket JSONs below. Am I doing something wrong?
CreateTicketJSON:
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://----/api/now/table/sc_req_item",
"httpMethod": "POST",
"httpParams": "{\"cat_item\":\"Other Services\", \"comments\":\"Test\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "result.number",
"ticketStatusPath": "result.state",
"ticketStatusValue": [
"Open",
"OPEN",
"open"
],
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}
TicketStatusJSON:
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://----/api/now/table/sc_req_item?sysparm_query=sysparm_query=request.number=${ticketID}&sysparm_limit=1&ysparm_display_value=true&sysparm_limit=1",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketStatusPath": "result[0].state",
"ticketStatusValue":[
"Open",
"OPEN",
"open"
],
"successResponses": [
{}
]
}
]
}
06/07/2023 10:27 AM
Can you update the ticketStatusValue that reflects to a closed value in Target application in place of Open value you have defined.
06/07/2023 01:05 PM
I tried that as well but I had no luck.
I attempted changing my createTicket & TicketStatus JSON to create tasks instead of RITM and now I get the issue where a "add access" task will remain in "Pending Provision" status even after the ticket is closed in ServiceNow. Here is that JSON:
Create JSON:
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://-----/api/now/table/sc_task",
"httpMethod": "POST",
"httpParams": "{\"bp_id\":\"$user.username\",\"name\":\"$user.lastname, $user.firstname\",\"email\":\"$user.email\",\"priority\":\"2\",\"assignment_group\":\"Identity\",\"short_description\": \"Please certify access for the user\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "result.number",
"unsuccessResponses": {
"message": "Ticket Creation Failed"
}
}
]
}
Ticket JSON:
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://------/api/now/table/sc_task?sysparm_query=number=${ticketID}&sysparm_limit=1&sparm_display_value=true",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketStatusPath": "result[0].state",
"ticketStatusValue": [
"Open",
"OPEN",
"open"
],
"successResponses": [
{}
]
}
]
}
06/21/2023 10:40 AM
Can you update the above TicketstatusJSON with the below and run the job. Also, keep the above CreateTicketJSON as is.
"ticketStatusPath": "result.state",
"ticketStatusValue": [
"1"
]
06/21/2023 10:57 AM
Tried that just now and it looks like I am getting the following error. Any idea how to fix it?
2023-06-21 17:54:31,199 [quartzScheduler_Worker-2] ERROR services.ArsTaskService - Exception
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';Ticket Number=TASK1321170; WHERE ACCOUNTKEY=4307654' at line 1
06/08/2023 06:20 AM
Please find below the modified TicketStatusJSON:
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://------/api/now/table/sc_task?sysparm_query=number=${ticketID}&sysparm_limit=1&sysparm_display_value=true",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketStatusPath": "result[0].state",
"ticketStatusValue": ["3"],
"successResponses": [{}]
}
]
}
Please validate and let us know if further assistance is needed.
06/14/2023 11:26 AM
No luck. Here is what I am seeing in the error logs. It might be an issue with Saviynt bring in an extra ";" when fetching the Ticket Number.
2023-06-14 18:20:52,429 [quartzScheduler_Worker-2] ERROR rest.RestProvisioningService - Call response: {"result":{"parent":"","made_sla":"true","watch_list":"","sc_catalog":"","upon_reject":"cancel","sys_updated_on":"2023-06-14 18:20:52","task_effective_number":"TASK1321080","approval_history":"","skills":"","number":"TASK1321080","sys_updated_by":"svc_saviynt","opened_by":{"link":"https://-----.com/api/now/table/sys_user/52d511221b7e38509d9963dce54bcb46","value":"52d511221b7e38509d9963dce54bcb46"},"user_input":"","sys_created_on":"2023-06-14 18:20:52","sys_domain":{"link":"https://-----/api/now/table/sys_user_group/global","value":"global"},"state":"1","route_reason":"","sys_created_by":"svc_saviynt","knowledge":"false","order":"","u_resource_level_of_effort":"1","calendar_stc":"","closed_at":"","cmdb_ci":"","delivery_plan":"","u_work_notes_summary":"","contract":"","impact":"3","active":"true","work_notes_list":"","business_service":"","priority":"2","time_worked":"","expected_start":"","u_process_name":"","opened_at":"2023-06-14 18:20:52","business_duration":"","group_list":"","work_end":"","approval_set":"","work_notes":"","universal_request":"","request":"","short_description":"Please certify access for the user","u_reason_codes":"","correlation_display":"","delivery_task":"","work_start":"2023-06-14","assignment_group":{"link":"https://-----/api/now/table/sys_user_group/247b23d51b059450cb59db9ee54bcb89","value":"247b23d51b059450cb59db9ee54bcb89"},"additional_assignee_list":"","description":"","calendar_duration":"","close_notes":"","service_offering":"","sys_class_name":"sc_task","closed_by":"","follow_up":"","sys_id":"43f0d4b31b9be550e8dc63dce54bcbc9","contact_type":"","u_accessible_to":"-,-,-,-,247b23d51b059450cb59db9ee54bcb89","urgency":"3","company":"","reassignment_count":"0","activity_due":"","assigned_to":"","comments":"","approval":"not requested","sla_due":"","comments_and_work_notes":"","due_date":"","sys_mod_count":"0","request_item":"","sys_tags":"","escalation":"0","upon_approval":"proceed","correlation_id":"","location":""}}
2023-06-14 18:20:52,429 [quartzScheduler_Worker-2] ERROR rest.RestProvisioningService - callResponseMap: [result:[parent:, made_sla:true, watch_list:, sc_catalog:, upon_reject:cancel, sys_updated_on:2023-06-14 18:20:52, task_effective_number:TASK1321080, approval_history:, skills:, number:TASK1321080, sys_updated_by:svc_saviynt, opened_by:[link:https://-----/api/now/table/sys_user/52d511221b7e38509d9963dce54bcb46, value:52d511221b7e38509d9963dce54bcb46], user_input:, sys_created_on:2023-06-14 18:20:52, sys_domain:[link:https://------/api/now/table/sys_user_group/global, value:global], state:1, route_reason:, sys_created_by:svc_saviynt, knowledge:false, order:, u_resource_level_of_effort:1, calendar_stc:, closed_at:, cmdb_ci:, delivery_plan:, u_work_notes_summary:, contract:, impact:3, active:true, work_notes_list:, business_service:, priority:2, time_worked:, expected_start:, u_process_name:, opened_at:2023-06-14 18:20:52, business_duration:, group_list:, work_end:, approval_set:, work_notes:, universal_request:, request:, short_description:Please certify access for the user, u_reason_codes:, correlation_display:, delivery_task:, work_start:2023-06-14, assignment_group:[link:https://------/api/now/table/sys_user_group/247b23d51b059450cb59db9ee54bcb89, value:247b23d51b059450cb59db9ee54bcb89], additional_assignee_list:, description:, calendar_duration:, close_notes:, service_offering:, sys_class_name:sc_task, closed_by:, follow_up:, sys_id:43f0d4b31b9be550e8dc63dce54bcbc9, contact_type:, u_accessible_to:-,-,-,-,247b23d51b059450cb59db9ee54bcb89, urgency:3, company:, reassignment_count:0, activity_due:, assigned_to:, comments:, approval:not requested, sla_due:, comments_and_work_notes:, due_date:, sys_mod_count:0, request_item:, sys_tags:, escalation:0, upon_approval:proceed, correlation_id:, location:]]
2023-06-14 18:20:53,373 [quartzScheduler_Worker-2] ERROR ldap.SaviyntGroovyLdapService - Error in getAccountDnAttrList : No such property: ImportUtilityService for class: com.saviynt.ldap.SaviyntGroovyLdapService
Possible solutions: importUtilityService
2023-06-14 18:20:55,975 [quartzScheduler_Worker-2] ERROR services.ArsTaskService - Exception
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';Ticket Number=TASK1321080; WHERE ACCOUNTKEY=4046930' at line 1
at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
at com.mysql.jdbc.Util.getInstance(Util.java:383)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1062)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4208)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4140)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2597)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2758)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2820)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1759)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1679)
at com.saviynt.ldap.SaviyntGroovyLdapService.updateLdapAccountFromProvMetadata(SaviyntGroovyLdapService.groovy:5078)
at com.saviynt.ecm.services.ArsTaskService.updateAccFromProvMetadata(ArsTaskService.groovy:13522)
at com.saviynt.ecm.services.ArsTaskService$_provisionAccesstoAccountSaviynt_closure152_closure281.doCall(ArsTaskService.groovy:11760)
at com.saviynt.ecm.services.ArsTaskService$_provisionAccesstoAccountSaviynt_closure152.doCall(ArsTaskService.groovy:11147)
at com.saviynt.ecm.services.ArsTaskService.provisionAccesstoAccountSaviynt(ArsTaskService.groovy:11118)
at com.saviynt.ecm.services.ArsTaskHelperService$_whenTaskTypeIsOneAddAccess_closure45.doCall(ArsTaskHelperService.groovy:2738)
at com.saviynt.ecm.services.ArsTaskHelperService.whenTaskTypeIsOneAddAccess(ArsTaskHelperService.groovy:2722)
at com.saviynt.ecm.services.ArsTaskHelperService$_completeAutoProvTasksUpgraded_closure1.doCall(ArsTaskHelperService.groovy:152)
at com.saviynt.ecm.services.ArsTaskHelperService.completeAutoProvTasksUpgraded(ArsTaskHelperService.groovy:147)
at MultipleProvisioningJob.execute(MultipleProvisioningJob.groovy:222)
at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
12/29/2023 02:06 PM
This seems code issue where mysql not able to update status properly can you share postman screenshot of ticket response
01/01/2024 11:11 PM
07/07/2023 10:51 AM
Can you confirm if this is still and issue or was this resolved.
07/07/2023 10:53 AM
This is still an ongoing issue.
07/20/2023 10:03 AM - edited 07/20/2023 10:03 AM
Can you run this via postman and share the output in a text file. Alternatively, can you update ConfigJSON param in the REST connection with value {"showLogs":true}. Run the prov job and share the logs for it.
12/29/2023 06:41 AM
Hello,
Is this issue is resolved. I have the same issue the task in Saviynt are not closed it shows as pending provision ?
Any help here
01/02/2024 06:10 AM - edited 01/02/2024 06:10 AM
The issue was not resolved
01/02/2024 06:12 AM
then, Is this a product issue /bug ?
01/05/2024 02:10 AM
Hi Diego,
Check for the security system, you might have mapped Service Desk Connection and Provisioning Connection both.
If that is the case, please remove provisioning connection and try. Do let us know if it resolved the issue.
Thanks,
Ranjan