03/01/2023 04:28 PM - edited 03/01/2023 04:50 PM
Hi All,
I am using multiple calls in CreateAccountJson and one of the calls is to get the user's manager & populate it in the target applications' manager field. I am trying to reference the manager's username to achieve this. I am trying the below call for this, but it returns null. Is there anything else I can use apart from ${managerAccount.accountID} ?
{
"name": "call3",
"connection": "acctAuth",
"url": "https://xyz/api/now/table/sys_user?sysparm_query=employee_number=${managerAccount.accountID}&sysparm...",
"httpMethod": "GET",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
},
03/01/2023 04:59 PM
please try using ${usermanager.username}
03/07/2023 02:53 PM
I'm sorry but this did not work for me either.
03/08/2023 12:50 AM
call2.response.accountID
03/07/2023 09:39 PM
Could you please try the following to fetch the manager's username?
${com.saviynt.ecm.identitywarehouse.domain.Users.findById(user?.manager)?.username}
03/17/2023 02:56 PM
@amit_krishnajit - this did not work either
"name": "call3",
"connection": "acctAuth",
"url": "https://xyz.service-now.com/api/now/table/sys_user?sysparm_query=employee_number=${com.saviynt.ecm.i...",
"httpMethod": "GET",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
},
03/19/2023 08:54 PM
Could you please try the following expression?
${com.saviynt.ecm.identitywarehouse.domain.Users.get(user?.manager)?.username}
03/17/2023 03:04 PM
If anyone can help with a working copy of createAccountJson where a manager's ID is passed, please provide it to me. I wasn't able to find anything in the integration guide either.
03/18/2023 02:04 AM
Hi @sushmita,
By looking at below documentation, the manager's binding variable is case sensitive and is called userManager.
https://saviynt.freshdesk.com/support/solutions/articles/43000521736-rest-connector-guide
Therefore, could you try using ${userManager.username} and let us know if that works ?
Hope this helps !
03/20/2023 02:18 PM
Hi @adriencosson , I tried this initially when I went through the guide, but it did not work.
"name": "call3",
"connection": "acctAuth",
"url": "https://xyz.service-now.com/api/now/table/sys_user?sysparm_query=employee_number=${userManager.usern...",
"httpMethod": "GET",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
},
{
"name": "call4",
"connection": "acctAuth",
"url": "https://xyz.service-now.com/api/now/table/sys_user",
"httpMethod": "POST",
"httpParams": "{\"email\":\"${user.email}\",\"first_name\":\"${user.firstname}\",\"last_name\":\"${user.lastname}\",\"employee_number\":\"${user.username}\",\"title\":\"${user.title}\",\"u_llb_wrk_ext\":\"${user.phonenumber}\",\"active\":\"false\",\"u_user_principal_name\":\"${user.email}\",\"u_llb_mail_drop\":\"${user.locationnumber}\",\"u_start_date\":\"${user.startdate}\",\"department\":\"${response.call1.message.result[0].sys_id}\",\"building\":\"${response.call2.message.result[0].sys_id}\",\"manager\":\"${response.call3.message.result[0].sys_id}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"unsuccessResponses": {
"error.message": "Operation Failed"
}
}
]
03/20/2023 07:56 PM
Please share full json
03/20/2023 10:57 PM
{
"accountIdPath": "call4.message.result.sys_id",
"responseColsToPropsMap": {},
"call": [{
"name": "call1",
"connection": "acctAuth",
"url": "https://xyx.service-now.com/api/now/table/cmn_department?sysparm_query=name=${user.costcenter}&syspa...",
"httpMethod": "GET",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
},
{
"name": "call2",
"connection": "acctAuth",
"url": "https://xyx.service-now.com/api/now/table/cmn_building?sysparm_query=name=${user.locationnumber}&sys...",
"httpMethod": "GET",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
},
{
"name": "call3",
"connection": "acctAuth",
"url": "https://xyx.service-now.com/api/now/table/sys_user?sysparm_query=employee_number=${userManager.usern...",
"httpMethod": "GET",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
},
{
"name": "call4",
"connection": "acctAuth",
"url": "https://xyx.service-now.com/api/now/table/sys_user",
"httpMethod": "POST",
"httpParams": "{\"email\":\"${user.email}\",\"first_name\":\"${user.firstname}\",\"last_name\":\"${user.lastname}\",\"employee_number\":\"${user.username}\",\"title\":\"${user.title}\",\"u_llb_wrk_ext\":\"${user.phonenumber}\",\"active\":\"false\",\"u_user_principal_name\":\"${user.email}\",\"u_llb_mail_drop\":\"${user.locationnumber}\",\"u_start_date\":\"${user.startdate}\",\"department\":\"${response.call1.message.result[0].sys_id}\",\"building\":\"${response.call2.message.result[0].sys_id}\",\"manager\":\"${response.call3.message.result[0].sys_id}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"unsuccessResponses": {
"error.message": "Operation Failed"
}
}
]
}