Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/02/2024 09:06 AM
Hi! Im trying to do account-entitlement mapping during import for selected accounts
I have two types of accounts: Service Account and User Account types. I need to import the User Accounts because I have separate entitlement type for them. Both accounts are added to Groups but I only need the mapping for Service Accounts. Here is my JSON. Any suggestions, please?
"acctEntParams": {
"entTypes": {
"Group": {
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://domainname.service-now.com/api/now/v1/table/sys_user?sysparm_limit=2500&sysparm_query=u_savy...",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "result",
"keyField": "accountID",
"statusConfig": {
"active": "true",
"inactive": "false"
},
"colsToPropsMap": {
"accountID": "sys_id~#~char",
"name": "user_name~#~char"
},
"pagination": {
"nextUrl": {
"nextUrlPath": "${headers?.Link?.split(';')?.size()==5?headers?.Link?.split(';')[2]?.replace('rel=\"prev\",<', '')?.replace('>','')?.trim():headers?.Link?.split(';')?.size()==4 && headers?.Link?.split(';')[2].contains('rel=\"next\",<')?headers?.Link?.split(';')[1]?.replace('rel=\"first\",<', '')?.replace('>','')?.trim():null}"
}
}
},
"call2": {
"callOrder": 1,
"stageNumber": 3,
"connection": "userAuth",
"processingType": "http",
"http": {
"url": "https://domainname.service-now.com/api/now/v1/table/sys_user_grmember?sysparm_limit=1000&sysparm_que...${accountID}",
"httpContentType": "application/json",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
}
},
"inputParams": {
"dependentCall": true
},
"listField": "",
"acctKeyField": "accountID",
"entKeyField": "entitlementID",
"acctIdPath": "user.value",
"entIdPath": "group.value",
"pagination": {
"nextUrl": {
"nextUrlPath": "${headers?.Link?.split(';')?.size()==5?headers?.Link?.split(';')[2]?.replace('rel=\"prev\",<', '')?.replace('>','')?.trim():headers?.Link?.split(';')?.size()==4 && headers?.Link?.split(';')[2].contains('rel=\"next\",<')?headers?.Link?.split(';')[1]?.replace('rel=\"first\",<', '')?.replace('>','')?.trim():null}"
}
}
}
}
}
}
}
Solved! Go to Solution.
07/02/2024 10:17 AM
{
"acctEntParams": {
"entTypes": {
"Group": {
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://domainname.service-now.com/api/now/v1/table/sys_user?sysparm_limit=2500&sysparm_query=u_savy...",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "result",
"keyField": "accountID",
"statusConfig": {
"active": "true",
"inactive": "false"
},
"colsToPropsMap": {
"accountID": "sys_id~#~char",
"name": "user_name~#~char"
},
"pagination": {
"nextUrl": {
"nextUrlPath": "${headers?.Link?.split(';')?.size()==5?headers?.Link?.split(';')[2]?.replace('rel=\"prev\",<', '')?.replace('>','')?.trim():headers?.Link?.split(';')?.size()==4 && headers?.Link?.split(';')[2].contains('rel=\"next\",<')?headers?.Link?.split(';')[1]?.replace('rel=\"first\",<', '')?.replace('>','')?.trim():null}"
}
}
},
"call2": {
"callOrder": 1,
"stageNumber": 3,
"connection": "userAuth",
"processingType": "http",
"http": {
"url": "https://domainname.service-now.com/api/now/v1/table/sys_user_grmember?sysparm_limit=1000&sysparm_query=active=true^user.sys_idINjavascript:gs.groupMembers(\u0027${accountID}\u0027)${accountID}",
"httpContentType": "application/json",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
}
},
"inputParams": {
"dependentCall": true
},
"listField": "",
"acctKeyField": "accountID",
"entKeyField": "entitlementID",
"acctIdPath": "user.value",
"entIdPath": "group.value",
"pagination": {
"nextUrl": {
"nextUrlPath": "${headers?.Link?.split(';')?.size()==5?headers?.Link?.split(';')[2]?.replace('rel=\"prev\",<', '')?.replace('>','')?.trim():headers?.Link?.split(';')?.size()==4 && headers?.Link?.split(';')[2].contains('rel=\"next\",<')?headers?.Link?.split(';')[1]?.replace('rel=\"first\",<', '')?.replace('>','')?.trim():null}"
}
}
}
}
}
}
}
}
07/03/2024 01:34 AM
Thanks, @rushikeshvartak However, still getting the error:
Failed url-https://domainname.service-now.com/api/now/v1/table/sys_user_grmember?sysparm_limit=1000&sysparm_query=active=true^user.sys_idINjavascript:gs.groupMembers('${accountID}')${accountID} for entType-Group with Error Message-null
07/03/2024 12:06 PM - edited 07/03/2024 12:08 PM
Im thinking of just excluding the groups not added to ServiceAccounts. However, in ServiceNow REST API, conditions like "NOT EQUAL" has != characters. Do you know how to escape that from the ImportAcctEntJSON? I'm getting null error when I use it. This is the URL. Response looks good in Postman.
https://doamin.service-now.com/api/now/v1/table/sys_user_group?sysparm_limit=1000&sysparm_query=name!=ServiceNow_DEV_Admin
07/05/2024 01:42 PM
07/09/2024 01:32 AM
07/09/2024 07:15 AM
Share working config