Webservice After rule Query

Hi All,
I created a after rule for my webservice connector
import connector.common.JsonUtil;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;
import sailpoint.tools.GeneralException;

Map updatedMapInfo = new HashMap();
List Finallist = new ArrayList();

Map response = (Map) JsonUtil.toMap(rawResponseObject);
log.error(" RULES response at start: " + response);

if (response.get(“Data”) != null) {
List dataList = (List) response.get(“Data”);

for (int i = 0; i < dataList.size(); i++) {
    Map user = (Map) dataList.get(i);
    Map newmap = new HashMap();

    newmap.put("Name", user.get("Name"));
    newmap.put("PrimaryPurchasingOrganization", user.get("Primary Purchasing Organization"));
    newmap.put("PrimarySupervisor", user.get("Primary Supervisor"));
    newmap.put("Role", user.get("Role"));
    newmap.put("UserStatus", user.get("User Status"));
    newmap.put("SignatureAuthorityAmount", user.get("Signature Authority Amount"));
    newmap.put("Language", user.get("Language"));
    newmap.put("EmployeeID", user.get("Employee ID"));
    newmap.put("DefaultCostObject", user.get("Default Cost Object"));
    newmap.put("AdditionalRoles", user.get("Additional Roles"));
    newmap.put("Username", user.get("Username"));
    newmap.put("DefaultCompanyCode", user.get("Default Company Code"));
    newmap.put("SignatureAuthorityCurrency", user.get("Signature Authority Currency"));
    newmap.put("Currency", user.get("Currency"));
    newmap.put("DefaultLocation", user.get("Default Location"));
    newmap.put("DefaultLocationCode", user.get("Default Location Code"));
    newmap.put("CountryRegion", user.get("Country/Region"));
    newmap.put("Email", user.get("Email"));
    newmap.put("PhoneNumber", user.get("Phone Number"));
    newmap.put("StateProvince", user.get("State/Province"));
    newmap.put("UserCreateDate", user.get("User Create Date"));

    Finallist.add(newmap);
}

}

updatedMapInfo.put(“Data”, Finallist);
log.error(" RULES Finallist at end: " + Finallist);
log.error(" RULES updatedMapInfo is: " + updatedMapInfo);
log.error(" RULES processedResponseObject after is " + processedResponseObject);

return updatedMapInfo;

This code is working and i logs i saw the values coming for
RULES updatedMapInfo is: {data=[{UserCreateDate=03/23/2023 18:13, [email protected], DefaultLocationCode=, StateProvince=, AdditionalRoles=, CountryRegion=, SignatureAuthorityAmount=, DefaultLocation=, UserStatus=Open, Name=integration 1, sd, Role=Administrator, PrimarySupervisor=integration 1, sd, PrimaryPurchasingOrganization=sdCorporation, Language=en_US, DefaultCompanyCode=, Username=sd, DefaultCostObject=, Currency=USD, PhoneNumber=, SignatureAuthorityCurrency=, EmployeeID=}, {UserCreateDate=03/23/2023 18:13, [email protected], DefaultLocationCode=, StateProvince=, AdditionalRoles=, CountryRegion=, SignatureAuthorityAmount

How to i need to map this in account aggregation operation?

@Deepanshu07

Have you tried aggregating ?
As I see you already mapped and returning the updatedMap .
The aggregation should get updated attribute data

Or , if you are looking to attach the rule to the account aggregation operation :

Use Patch to update the source :

API End Point : https://tenant.api.identitynow.com/v3/sources/:id

Body

[
  {
    "op": "add",
    "path": "/connectorAttributes/connectionParameters/positionOfAccountAggregationOperation/afterRule",
    "value": "Your Rule Name"
  }
]

Hope this helps

Agg is working but the attributes which are not getting updated.
I actually had the accounts already present and then created this rule to populate the remaining fields but they are not geting populated.

QQ:
Once i return the updatedMap via the rule in account agg i need to map accounting to that only right?

Also do i need to reset the accounts and then try?

@Deepanshu07

Attached the rule ?

Yes , give it a try by resetting the accounts

Yes that all is done that is why i am getting logs as well:

Tried post resetting:
this was in logs:

FIELDGLASS RULES updatedMapInfo is: {Data=[{UserCreateDate=03/23/2023 18:13, [email protected], DefaultLocationCode=, StateProvince=, AdditionalRoles=, CountryRegion=, SignatureAuthorityAmount=, DefaultLocation=, UserStatus=Open, Name=integration 1, ariba, Role=Administrator, PrimarySupervisor=integration 1, ariba, PrimaryPurchasingOrganization=McKesson Corporation, Language=en_US, DefaultCompanyCode=, Username=masked_username, DefaultCostObject=, Currency=USD, PhoneNumber=, SignatureAuthorityCurrency=, EmployeeID=masked_employee_id}, 
{UserCreateDate=03/23/2023 18:13, [email protected], DefaultLocationCode=, StateProvince=, AdditionalRoles=, CountryRegion=, SignatureAuthorityAmount=, DefaultLocation=, UserStatus=Open, Name=Administrator, Fieldglass, Role=Administrator, PrimarySupervisor=integration 1, ariba, PrimaryPurchasingOrganization=McKesson Corporation, Language=en_US, DefaultCompanyCode=, Username=masked_username, DefaultCostObject=, Currency=USD, PhoneNumber=, SignatureAuthorityCurrency=, EmployeeID=masked_employee_id}, 
{UserCreateDate=03/24/2023 11:28, [email protected], DefaultLocationCode=, StateProvince=, AdditionalRoles=, CountryRegion=, SignatureAuthorityAmount=, DefaultLocation=, UserStatus=Open, Name=API USER, SCIM, Role=Scim User Provision, PrimarySupervisor=integration 1, ariba, PrimaryPurchasingOrganization=McKesson Corporation, Language=en_US, DefaultCompanyCode=, Username=masked_username, DefaultCostObject=, Currency=USD, PhoneNumber=, SignatureAuthorityCurrency=, EmployeeID=masked_employee_id}, 
{UserCreateDate=08/20/2024 12:14, [email protected], DefaultLocationCode=, StateProvince=, AdditionalRoles=, CountryRegion=, SignatureAuthorityAmount=, DefaultLocation=, UserStatus=Open, Name=User, Integration, Role=Integration User, PrimarySupervisor=Administrator, Fieldglass, PrimaryPurchasingOrganization=McKesson Corporation, Language=en_US, DefaultCompanyCode=, Username=masked_username, DefaultCostObject=, Currency=USD, PhoneNumber=, SignatureAuthorityCurrency=, EmployeeID=masked_employee_id}, 
{UserCreateDate=08/20/2024 12:15, [email protected], DefaultLocationCode=, StateProvince=, AdditionalRoles=, CountryRegion=, SignatureAuthorityAmount=, DefaultLocation=, UserStatus=Open, Name=Integration, Ariba, Role=Ariba Integration, PrimarySupervisor=Administrator, Fieldglass, PrimaryPurchasingOrganization=McKesson Corporation, Language=en_US, DefaultCompanyCode=, Username=masked_username, DefaultCostObject=, Currency=USD, PhoneNumber=, SignatureAuthorityCurrency=, EmployeeID=masked_employee_id}, 
{UserCreateDate=08/20/2024 12:16, [email protected], DefaultLocationCode=, StateProvince=, AdditionalRoles=, CountryRegion=, SignatureAuthorityAmount=, DefaultLocation=, UserStatus=Open, Name=Administrator, Fieldglass, Role=Configuration Manager, PrimarySupervisor=, PrimaryPurchasingOrganization=McKesson Corporation, Language=en_US, DefaultCompanyCode=, Username=masked_username, DefaultCostObject=, Currency=USD, PhoneNumber=, SignatureAuthorityCurrency=, EmployeeID=masked_employee_id}, 
{UserCreateDate=09/05/2024 10:43, [email protected], DefaultLocationCode=, StateProvince=, AdditionalRoles=Category Team, CountryRegion=, SignatureAuthorityAmount=, DefaultLocation=, UserStatus=Open, Name=Ops, OSW, Role=OSW Ops, PrimarySupervisor=integration 1, ariba, PrimaryPurchasingOrganization=McKesson Corporation, Language=en_US, DefaultCompanyCode=, Username=masked_username, DefaultCostObject=, Currency=USD, PhoneNumber=, SignatureAuthorityCurrency=, EmployeeID=masked_employee_id}]}

Still all attributes are not getting updated:
Below is the source code for account agg:
{
“httpMethodType”: “GET”,
“pagingInitialOffset”: 0,
“sequenceNumberForEndpoint”: “3”,
“uniqueNameForEndPoint”: “Account Aggregation”,
“afterRule”: “XYZ-AfterRule-AccountAgg-Fieldglass”,
“rootPath”: “$.Data[*]”,
“body”: {
“jsonBody”: null,
“bodyFormat”: “raw”
},
“paginationSteps”: null,
“responseCode”: [
“2**”
],
“resMappingObj”: {
“State Province”: “StateProvince”,
“Email”: “Email”,
“User Create Date”: “UserCreateDate”,
“Default Company Code”: “DefaultCompanyCode”,
“Default Cost Centre”: “DefaultCostCentre”,
“Default Location Code”: “DefaultLocationCode”,
“Employee ID”: “EmployeeID”,
“Default Location”: “DefaultLocation”,
“User Status”: “UserStatus”,
“Signature Authority Currency”: “SignatureAuthorityCurrency”,
“Name”: “Name”,
“Role”: “Role”,
“Additional Roles”: “AdditionalRoles”,
“Language”: “Language”,
“Username”: “Username”,
“Currency”: “Currency”,
“Country/Region”: “CountryRegion”,
“Phone Number”: “PhoneNumber”
},

Which attribute are you trying to update ? And with what value ?

The key value in the newmap must match tha schema attribute