Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

ServiceNow selected Account-Ent mapping

jezzanuena
Regular Contributor II
Regular Contributor II

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}"
}
}
}
}
}
}
}

6 REPLIES 6

rushikeshvartak
All-Star
All-Star
{
  "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&colon;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}"
              }
            }
          }
        }
      }
    }
  }
}

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

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&colon;gs.groupMembers('${accountID}')${accountID} for entType-Group with Error Message-null

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

https://domain.service-now.com/api/now/v1/table/sys_user_group?sysparm_limit=1000&sysparm_query=name...


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Thanks, @rushikeshvartak . This is resolved. I separated the accountID path for each account type.

Share working config


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.