Click HERE to see how Saviynt Intelligence is transforming the industry. |
01/05/2024 02:21 AM - edited 01/05/2024 02:22 AM
Hello Team,
We are working on an integration where we need to use serviceNow as trusted source for users.
Can someone share the json for ImportUserJSON
01/07/2024 07:58 PM - edited 01/07/2024 11:41 PM
Hello @Manu269,
You may try with the below sample for the userimportjson for the servicenow.
{
"connection": "userAuth",
"url": "https://xxxx.service-now.com/api/now/table/sys_user?sysparm_display_value=true",
"httpMethod": "GET",
"httpHeaders": {
"contentType": "application/json",
"Authorization": "${access_token}"
},
"colsToPropsMap": {
"employeeid": "employee_number~#~char",
"lastname": "last_name~#~char",
"displayname": "name~#~char",
"firstname": "first_name~#~char",
"departmentname": "department.display_value~#~char",
"email": "email~#~char",
"country": "country~#~char",
"phonenumber": "mobile_phone~#~char",
"title": "title~#~char",
"username": "name~#~char",
"customproperty3": "active~#~char",
"customproperty11": "manager~#~char",
"startdate": "u_start_date~#~date",
"enddate": "u_end_date~#~date",
"employeetype": "u_employee_type~#~char",
"customproperty2": "sys_id~#~char",
"customproperty5": "u_manager~#~char",
"customproperty1": "u_number~#~char"
},
"userResponsePath": "result"
}
Thanks.
01/07/2024 09:54 PM
@sudeshjaiswal few more questions :
1. How do we handle the pagination logic?
2. How do we map active inactive status?
3. How do we map manager, department, company, cost_center attribute? The reason behind these attrributes has a link.
01/07/2024 11:36 PM
Hello @Manu269,
1. How do we handle the pagination logic?
"pagination": {
"offset": {
"offsetParam": "sysparm_offset",
"batchParam": "sysparm_limit",
"batchSize": 500,
"totalCountPath": "headers.x-total-count"
}
},
2. How do we map active inactive status?
There are two ways to control either you can define in the json "Support for importing the status information of users to IGA using the statusConfig attribute"
For Ref: https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm
or through the userimportjob.
3. How do we map manager, department, company, cost_center attribute? The reason behind these attrributes has a link.
You can refer the above json and do the changes accordingly as per your requirement.
Thanks.
01/09/2024 03:07 AM
@sudeshjaiswal I tried this :
{
"connection": "ServiceNow",
"url": "https://XXXX.service-now.com/api/now/table/sys_user?sysparm_limit=10000&sysparm_display_value=true&u...",
"httpMethod": "GET",
"httpHeaders": {
"contentType": "application/json",
"Authorization": "${access_token}"
},
"colsToPropsMap": {
"employeeid": "employee_number~#~char",
"lastname": "last_name~#~char",
"displayname": "name~#~char",
"firstname": "first_name~#~char",
"departmentname": "department.display_value~#~char",
"location": "location.display_value~#~char",
"email": "email~#~char",
"manager": "manager.display_value~#~char",
"country": "country~#~char",
"phonenumber": "mobile_phone~#~char",
"title": "title~#~char",
"city": "city~#~char",
"street": "street~#~char",
"username": "user_name~#~char",
"CUSTOMPROPERTY3": "active~#~char",
"CUSTOMPROPERTY11": "manager.display_value~#~char",
"startdate": "u_start_date~#~date",
"enddate": "u_end_date~#~date",
"employeetype": "u_employee_type~#~char",
"CUSTOMPROPERTY2": "sys_id~#~char",
"CUSTOMPROPERTY5": "u_manager~#~char",
"JOB_FUNCTION": "u_job_function.display_value~#~char",
"CUSTOMPROPERTY1": "user_name~#~char"
},
"userResponsePath": "result",
"pagination": {
"offset": {
"offsetParam": "offset",
"batchParam": "max",
"batchSize": 1000,
"totalCountPath": "count"
},
"nextUrl": {
"nextUrlPath": "${headers?.Link?.split(',')?.size()==4?headers?.Link?.split(',')[2]?.replace('<', '')?.replace('>;rel=\"next\"','')?.trim():headers?.Link?.split(',')?.size()==3&&headers?.Link?.split(',')[1]?.contains('next')?headers?.Link?.split(',')[1]?.replace('<', '')?.replace('>;rel=\"next\"','')?.trim():null}"
}
}
}
We created separate connection to pull in the managers
{
"connection": "userAuth",
"url": "https://xxxx.service-now.com/api/now/table/sys_user?sysparm_limit=10000&user_name=Justina.Dragaj",
"httpMethod": "GET",
"httpHeaders": {
"contentType": "application/json",
"Authorization": "${access_token}"
},
"colsToPropsMap": {
"username": "user_name~#~char",
"CUSTOMPROPERTY11": "manager.value~#~char",
"CUSTOMPROPERTY2": "sys_id~#~char",
"CUSTOMPROPERTY15": "name~#~char"
},
"userResponsePath": "result",
"pagination": {
"offset": {
"offsetParam": "offset",
"batchParam": "max",
"batchSize": 1000,
"totalCountPath": "count"
},
"nextUrl": {
"nextUrlPath": "${headers?.Link?.split(',')?.size()==4?headers?.Link?.split(',')[2]?.replace('<', '')?.replace('>;rel=\"next\"','')?.trim():headers?.Link?.split(',')?.size()==3&&headers?.Link?.split(',')[1]?.contains('next')?headers?.Link?.split(',')[1]?.replace('<', '')?.replace('>;rel=\"next\"','')?.trim():null}"
}
}
}
Used following MODIFYUSERDATAJSON
{
"ADDITIONALTABLES": {
"USERS": "SELECT CUSTOMPROPERTY2,customproperty11, username FROM USERS"
},
"COMPUTEDCOLUMNS": [
"manager"
],
"PREPROCESSQUERIES": [
"update newuserdata set manager= (select m.username from currentusers m where customproperty11 = m.customproperty11 and customproperty11 is not null)"
]
}
Issue:
We are able to pull in the user but facing issue for mapping the manager to users.
Please assist.
01/09/2024 08:06 AM
Hello @Manu269,
Can you please provide the postman response?
Thanks.