Click HERE to see how Saviynt Intelligence is transforming the industry. |
06/25/2024 06:33 AM
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?
06/25/2024 08:38 PM - edited 06/25/2024 08:39 PM
use syntax with CONST