Leveraging Intelligent Recommendations for Operational Transformation. AMS Partners click HERE | EMEA/APJ Partners click HERE |
07/10/2024 05:45 PM
Hi All,
We have a use case of adding users to dynamicGroups in SuccessFactors. I'm using the add access JSON from the documentation for SuccessFactors DynamicGroups. In Saviynt, the task is completing successfully and it’s showing on the account repository, however, when validating in SuccessFactors it’s not showing there.
The only thing that’s updating in the dynamicGroup is the people pool drop down menu from user to username, not the actual users in the group. Additionally, it's also removing the existing users in the group.
Any ideas on how to resolve this?
For reference, here's the JSON I used:
{
"call": [
{
"name": "DynamicGroups",
"connection": "userAuth",
"url": "@@HOST_URL@@/odata/v2/getExpandedDynamicGroupById?groupId=${entitlementValue.entitlementID}L",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
},
{
"name": "DynamicGroups",
"connection": "userAuth",
"url": "@@HOST_URL@@/odata/v2/upsert",
"httpMethod": "POST",
"httpParams": "${Map finalMap = new HashMap();Map __metadata = new HashMap();__metadata.put('uri','DynamicGroup');finalMap.put('__metadata',__metadata);finalMap.put('groupID',entitlementValue.entitlementID);finalMap.put('groupType','permission');List dgIncludePoolsList= new ArrayList();Map dgIncludePoolsMap = new HashMap();Map DGPeoplePoolMetadata = new HashMap();DGPeoplePoolMetadata.put('uri','@@HOST_URL@@/odata/v2/DGPeoplePool');Map DGFilterMetadata = new HashMap();DGFilterMetadata.put('uri','@@HOST_URL@@/odata/v2/DGFilter');Map DGExpressionMetadata = new HashMap();DGExpressionMetadata.put('uri','@@HOST_URL@@/odata/v2/DGExpression');Map DGFieldOperatorMetadata = new HashMap();DGFieldOperatorMetadata.put('uri','@@HOST_URL@@/odata/v2/DGFieldOperator');Map DGFieldValueMetadata = new HashMap();DGFieldValueMetadata.put('uri','@@HOST_URL@@/odata/v2/DGFieldValue');Map DGFieldMetadata = new HashMap();DGFieldMetadata.put('uri','@@HOST_URL@@/odata/v2/DGField');dgIncludePoolsMap.put('__metadata',DGPeoplePoolMetadata);dgIncludePoolsMap.put('peoplePoolId',entitlementValue.entitlementID + '_1');List filtersList= new ArrayList();Map filtersMap = new HashMap();filtersMap.put('__metadata',DGFilterMetadata);List expressionsList= new ArrayList();Map expressionsMap = new HashMap();Map operator = new HashMap();List valuesList= new ArrayList();Map valuesLMap= new HashMap();String fieldValue='';List fieldValueList = response.DynamicGroups1.message.d.dgIncludePools.results[0].filters.results[0].expressions.results;for(int i=0;i<fieldValueList.size();i++){fieldValue=(fieldValueList.get(i)).values.results[0].fieldValue;if(fieldValue!=null) {expressionsMap = new HashMap();expressionsMap.put('__metadata', DGExpressionMetadata);operator = new HashMap();operator.put('__metadata', DGFieldOperatorMetadata);operator.put('token', 'eq');expressionsMap.put('operator', operator);valuesList = new ArrayList();valuesLMap = new HashMap();valuesLMap.put('__metadata', DGFieldValueMetadata);valuesLMap.put('fieldValue', fieldValue);valuesList.add(valuesLMap);expressionsMap.put('values', valuesList);expressionsList.add(expressionsMap);};};if(account.accountID!=null){expressionsMap = new HashMap();expressionsMap.put('__metadata', DGExpressionMetadata);operator = new HashMap();operator.put('__metadata', DGFieldOperatorMetadata);operator.put('token', 'eq');expressionsMap.put('operator', operator);valuesList = new ArrayList();valuesLMap = new HashMap();valuesLMap.put('__metadata', DGFieldValueMetadata);valuesLMap.put('fieldValue', account.accountID);valuesList.add(valuesLMap);expressionsMap.put('values', valuesList);expressionsList.add(expressionsMap);};filtersMap.put('expressions',expressionsList);Map fieldMap=new HashMap();fieldMap.put('__metadata',DGFieldMetadata);fieldMap.put('name','std_username');Map allowedOperatorsMap=new HashMap(); allowedOperatorsMap.put('__metadata',DGFieldOperatorMetadata);allowedOperatorsMap.put('token','eq');fieldMap.put('allowedOperators',allowedOperatorsMap);filtersMap.put('field',fieldMap);filtersList.add(filtersMap);dgIncludePoolsMap.put('filters',filtersList);dgIncludePoolsList.add(dgIncludePoolsMap);finalMap.put('dgIncludePools',dgIncludePoolsList);return new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(finalMap);}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"d[0].message": [
"Insert group is successful"
]
}
}
]
}
07/10/2024 09:02 PM
Is it working from postman ?