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

Parsing ownerIdPath from JSON value in REST connector for ImportAccountEntJSON Entitlement Owners

JKeyser
New Contributor II
New Contributor II

We have a ServiceNow REST connection that is mapping Entitlement Owners from Users provided through a separate connection. This is currently working properly by setting the ownerIdPath to the sys_created_by value returned from our ServiceNow Group endpoint.

 

 

  "entOwnerParams": {
    "entTypes": {
      "Group": {
        "call": {
          "call1": {
            "processingType": "httpOwner",
            "connection": "acctAuth",
            "showJobHistory": true,
            "callOrder": 0,
            "stageNumber": 0,
            "http": {
              "url": "XXXXXXXXX",
              "httpContentType": "application/json",
              "httpMethod": "GET",
              "httpHeaders": {
                "Accept": "application/json"
              }
            },
            "listField": "result",
            "entIdPath": "sys_id",
            "ownerIdPath": "sys_created_by",
            "ownerKeyField": "username",
            "entKeyField": "entitlementID"
          }
        }
      }
    }
  }

 

 

However, the actual group owner username is contained within a JSON object that we need to parse out.

 

 

"result": [
	{
		"manager": {
			"display_value": "Last, First (987654321)",
			"link": "XXXXXXXX"
		},
		"name": "Test Group",
		"sys_id": "XXXXXXXX"
		"sys_created_by": "123456789"
	}
]

 

 

We have tried to parse this username for the ownerIdPath using Groovy, but have been unable to map this value to the correct Entitlement Owner.

manager.display_value?.split('(')[1]?.replace(')', '')?.trim()

Is this possible here or is this syntax incorrect?

 

1 REPLY 1

rushikeshvartak
All-Star
All-Star

use syntax with CONST


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