Deployed ManagerCorrelation Rule does not appear to be executing

Hello,

I am working with a ManagerCorrelation Rule in SailPoint Identity Security Cloud and I have some questions regarding its execution.

The rule was developed and tested locally using the Rule Development Kit. It also passed the unit tests we created for the different manager-correlation scenarios. I then deployed the rule to the tenant, but after running aggregations and performing tests, I do not see any change in the identity manager.

The rule logic is as follows:

  • I have two authoritative sources associated with the same identity: a CSV source and a NERM source.
  • If the CSV account is active, the manager should be obtained from the Manager attribute.
  • If the NERM account is active, the manager should be obtained from erc_ne_attribute.
  • If both accounts are inactive, their end dates are compared and the manager from the source with the most recent end date is used.
  • The resulting value contains the manager’s username and should be correlated against the identity attribute uid.

The rule is already deployed, but I cannot determine whether:

  • the rule is failing during execution,
  • the rule is never being invoked,
  • or some additional configuration is required to associate it correctly with the authoritative sources/profiles.

Could you please clarify what configuration is required for a ManagerCorrelation Rule to be executed during aggregation?

I would also like to know whether there is any way to confirm through logs or an API that the rule is being invoked and what result it is returning.

My current intention is to use the same rule for both authoritative sources involved.

Any guidance or configuration example would be greatly appreciated.
"<?xml version='1.0' encoding='UTF-8'?>

Correlaciona dinamicamente el manager entre las fuentes CSV y NERM.

Si solo existe una cuenta, utiliza el manager de esa fuente.
Si existen ambas, utiliza CSV cuando esta activa y NERM cuando CSV esta inactiva y NERM activa.

Si ambas cuentas estan inactivas, compara la fecha “Account Expiry Time” de CSV con
“fecha_fin_asignacion_ne_attribute” de la asignacion NERM creada mas recientemente y utiliza
el manager de la fuente cuya fecha de finalizacion sea posterior.

CSV utiliza “Manager”, NERM utiliza “erc_ne_attribute” y el valor obtenido se correlaciona
contra el atributo de identidad “uid”.

<![CDATA[

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;

import sailpoint.object.Identity;
import sailpoint.object.Link;


/*
 * ==========================================================
 * SOURCES
 * ==========================================================
 */

// Fuente autoritativa CSV
String CSV_SOURCE_ID =
    "b";

// NERM - perfil Persona
String NERM_PERSONA_SOURCE_ID =
    "c";

// NERM - perfil Asignacion
String NERM_ASIGNACION_SOURCE_ID =
    "8";


/*
 * ==========================================================
 * ATRIBUTOS
 * ==========================================================
 */

String CSV_MANAGER_ATTR =
    "Manager";

String CSV_END_DATE_ATTR =
    "Account Expiry Time";

String NERM_MANAGER_ATTR =
    "erc_ne_attribute";

String NERM_END_DATE_ATTR =
    "fecha_fin_asignacion_ne_attribute";

String MANAGER_IDENTITY_ATTRIBUTE =
    "uid";


/*
 * ==========================================================
 * FUNCIONES AUXILIARES
 * ==========================================================
 */


/*
 * Obtiene la primera cuenta asociada a una fuente.
 *
 * Para CSV y NERM Persona se espera una unica
 * cuenta relevante por identidad.
 */
Link getFirstLinkBySourceId(
    Identity identity,
    String sourceId
) {

    if (identity == null || sourceId == null) {
        return null;
    }

    List links =
        identity.getLinksByAppIdOrName(
            sourceId,
            null
        );

    if (links != null && !links.isEmpty()) {
        return (Link) links.get(0);
    }

    return null;
}


/*
 * Obtiene la cuenta de NERM Asignacion
 * creada mas recientemente.
 *
 * Replica el criterio utilizado en la transform:
 *
 * accountSortAttribute = "created"
 * accountSortDescending = true
 */
Link getNewestLinkBySourceId(
    Identity identity,
    String sourceId
) {

    if (identity == null || sourceId == null) {
        return null;
    }

    List links =
        identity.getLinksByAppIdOrName(
            sourceId,
            null
        );

    if (links == null || links.isEmpty()) {
        return null;
    }

    Link newestLink = null;
    Date newestCreated = null;

    for (Object linkObject : links) {

        Link currentLink =
            (Link) linkObject;

        if (currentLink == null) {
            continue;
        }

        Date currentCreated =
            currentLink.getCreated();

        if (newestLink == null) {

            newestLink =
                currentLink;

            newestCreated =
                currentCreated;

            continue;
        }

        if (
            currentCreated != null &&
            (
                newestCreated == null ||
                currentCreated.after(newestCreated)
            )
        ) {

            newestLink =
                currentLink;

            newestCreated =
                currentCreated;
        }
    }

    return newestLink;
}


/*
 * Valida que el valor del manager
 * no sea nulo ni vacio.
 */
boolean hasManagerValue(
    Object value
) {

    if (value == null) {
        return false;
    }

    String text =
        String.valueOf(value).trim();

    return !text.isEmpty();
}


/*
 * Construye el resultado esperado por
 * la Manager Correlation Rule.
 */
Map buildCorrelationResult(
    Object managerValue
) {

    Map result =
        new HashMap();

    if (!hasManagerValue(managerValue)) {

        log.warn(
            "ManagerCorrelation-CAF - "
            + "El valor del manager es nulo o vacio."
        );

        return result;
    }

    String managerUsername =
        String.valueOf(managerValue).trim();

    result.put(
        "identityAttributeName",
        MANAGER_IDENTITY_ATTRIBUTE
    );

    result.put(
        "identityAttributeValue",
        managerUsername
    );

    log.warn(
        "ManagerCorrelation-CAF - "
        + "Correlacionando manager contra "
        + MANAGER_IDENTITY_ATTRIBUTE
        + " = "
        + managerUsername
    );

    return result;
}


/*
 * ==========================================================
 * INICIO DE LA REGLA
 * ==========================================================
 */

Map returnMap =
    new HashMap();


/*
 * La misma regla se utilizara tanto en CSV
 * como en NERM.
 *
 * Por lo tanto, link puede pertenecer
 * a cualquiera de las dos fuentes.
 */
if (link == null) {

    log.warn(
        "ManagerCorrelation-CAF - "
        + "El link recibido es nulo."
    );

    return returnMap;
}


Identity identity =
    link.getIdentity();


if (identity == null) {

    log.warn(
        "ManagerCorrelation-CAF - "
        + "No se pudo obtener la Identity "
        + "asociada al link."
    );

    return returnMap;
}


log.warn(
    "ManagerCorrelation-CAF - "
    + "Procesando Identity: "
    + identity.getName()
);


/*
 * Buscamos las cuentas de ambas
 * fuentes autoritativas.
 */
Link csvLink =
    getFirstLinkBySourceId(
        identity,
        CSV_SOURCE_ID
    );

Link nermPersonaLink =
    getFirstLinkBySourceId(
        identity,
        NERM_PERSONA_SOURCE_ID
    );


/*
 * ==========================================================
 * CASO 1
 *
 * Existe CSV y no existe NERM Persona.
 *
 * Se utiliza CSV independientemente
 * de su estado.
 * ==========================================================
 */
if (
    csvLink != null &&
    nermPersonaLink == null
) {

    log.warn(
        "ManagerCorrelation-CAF - "
        + "Existe cuenta CSV y no existe "
        + "cuenta NERM Persona. "
        + "Se utilizara Manager de CSV."
    );

    Object csvManager =
        csvLink.getAttribute(
            CSV_MANAGER_ATTR
        );

    return buildCorrelationResult(
        csvManager
    );
}


/*
 * ==========================================================
 * CASO 2
 *
 * No existe CSV y existe NERM Persona.
 *
 * Se utiliza NERM independientemente
 * de su estado.
 * ==========================================================
 */
if (
    csvLink == null &&
    nermPersonaLink != null
) {

    log.warn(
        "ManagerCorrelation-CAF - "
        + "No existe cuenta CSV y existe "
        + "cuenta NERM Persona. "
        + "Se utilizara erc_ne_attribute de NERM."
    );

    Object nermManager =
        nermPersonaLink.getAttribute(
            NERM_MANAGER_ATTR
        );

    return buildCorrelationResult(
        nermManager
    );
}


/*
 * ==========================================================
 * CASO 3
 *
 * No existe ninguna de las dos cuentas.
 * ==========================================================
 */
if (
    csvLink == null &&
    nermPersonaLink == null
) {

    log.warn(
        "ManagerCorrelation-CAF - "
        + "No se encontro cuenta CSV ni "
        + "cuenta NERM Persona."
    );

    return returnMap;
}


/*
 * A partir de este punto existen ambas cuentas.
 */


/*
 * ==========================================================
 * CASO 4
 *
 * CSV activa + NERM inactiva.
 *
 * Se utiliza CSV.
 * ==========================================================
 */
if (
    !csvLink.isDisabled() &&
    nermPersonaLink.isDisabled()
) {

    log.warn(
        "ManagerCorrelation-CAF - "
        + "CSV activa y NERM inactiva. "
        + "Se utilizara Manager de CSV."
    );

    Object csvManager =
        csvLink.getAttribute(
            CSV_MANAGER_ATTR
        );

    return buildCorrelationResult(
        csvManager
    );
}


/*
 * ==========================================================
 * CASO 5
 *
 * CSV inactiva + NERM activa.
 *
 * Se utiliza NERM.
 * ==========================================================
 */
if (
    csvLink.isDisabled() &&
    !nermPersonaLink.isDisabled()
) {

    log.warn(
        "ManagerCorrelation-CAF - "
        + "CSV inactiva y NERM activa. "
        + "Se utilizara erc_ne_attribute de NERM."
    );

    Object nermManager =
        nermPersonaLink.getAttribute(
            NERM_MANAGER_ATTR
        );

    return buildCorrelationResult(
        nermManager
    );
}


/*
 * ==========================================================
 * CASO 6
 *
 * CSV inactiva + NERM inactiva.
 *
 * Se comparan las fechas de finalizacion.
 * ==========================================================
 */
if (
    csvLink.isDisabled() &&
    nermPersonaLink.isDisabled()
) {

    log.warn(
        "ManagerCorrelation-CAF - "
        + "CSV y NERM se encuentran inactivas. "
        + "Se compararan las fechas de finalizacion."
    );


    /*
     * Fecha fin CSV.
     *
     * Ejemplo:
     * 15/11/2027 23:59
     */
    Object csvEndDateValue =
        csvLink.getAttribute(
            CSV_END_DATE_ATTR
        );


    /*
     * Buscamos la asignacion NERM
     * creada mas recientemente.
     */
    Link newestNermAssignment =
        getNewestLinkBySourceId(
            identity,
            NERM_ASIGNACION_SOURCE_ID
        );


    if (newestNermAssignment == null) {

        log.warn(
            "ManagerCorrelation-CAF - "
            + "No se encontro una cuenta de "
            + "NERM Asignacion."
        );

        return returnMap;
    }


    log.warn(
        "ManagerCorrelation-CAF - "
        + "Asignacion NERM mas reciente encontrada. "
        + "Created: "
        + newestNermAssignment.getCreated()
    );


    /*
     * Fecha fin NERM.
     *
     * Ejemplo:
     * 11/09/2026
     */
    Object nermEndDateValue =
        newestNermAssignment.getAttribute(
            NERM_END_DATE_ATTR
        );


    if (
        csvEndDateValue == null ||
        nermEndDateValue == null
    ) {

        log.warn(
            "ManagerCorrelation-CAF - "
            + "No se pudo obtener alguna de las "
            + "fechas de finalizacion requeridas."
        );

        return returnMap;
    }


    try {

        /*
         * Formato CSV:
         * 15/11/2027 23:59
         */
        SimpleDateFormat csvDateFormat =
            new SimpleDateFormat(
                "dd/MM/yyyy HH:mm"
            );


        /*
         * Formato NERM:
         * 11/09/2026
         */
        SimpleDateFormat nermDateFormat =
            new SimpleDateFormat(
                "dd/MM/yyyy"
            );


        csvDateFormat.setLenient(false);
        nermDateFormat.setLenient(false);


        Date csvEndDate =
            csvDateFormat.parse(
                String.valueOf(
                    csvEndDateValue
                ).trim()
            );


        Date nermEndDate =
            nermDateFormat.parse(
                String.valueOf(
                    nermEndDateValue
                ).trim()
            );


        log.warn(
            "ManagerCorrelation-CAF - "
            + "Fecha fin CSV: "
            + csvEndDate
            + " | Fecha fin NERM: "
            + nermEndDate
        );


        /*
         * Si CSV tiene la fecha de finalizacion
         * mas reciente, utilizamos su manager.
         */
        if (
            csvEndDate.after(
                nermEndDate
            )
        ) {

            log.warn(
                "ManagerCorrelation-CAF - "
                + "La fecha de finalizacion CSV "
                + "es mas reciente. "
                + "Se utilizara Manager de CSV."
            );

            Object csvManager =
                csvLink.getAttribute(
                    CSV_MANAGER_ATTR
                );

            return buildCorrelationResult(
                csvManager
            );
        }


        /*
         * Si NERM tiene la fecha mas reciente
         * o ambas fechas coinciden, utilizamos NERM.
         *
         * NERM queda como criterio de desempate.
         */
        log.warn(
            "ManagerCorrelation-CAF - "
            + "La fecha de finalizacion NERM "
            + "es mas reciente o coincide con CSV. "
            + "Se utilizara erc_ne_attribute de NERM."
        );

        Object nermManager =
            nermPersonaLink.getAttribute(
                NERM_MANAGER_ATTR
            );

        return buildCorrelationResult(
            nermManager
        );


    } catch (Exception e) {

        log.warn(
            "ManagerCorrelation-CAF - "
            + "Error comparando fechas de finalizacion: "
            + e.getMessage()
        );

        return returnMap;
    }
}


/*
 * ==========================================================
 * CASO DEFENSIVO
 *
 * CSV activa + NERM activa.
 *
 * Este escenario no deberia ocurrir.
 * ==========================================================
 */
if (
    !csvLink.isDisabled() &&
    !nermPersonaLink.isDisabled()
) {

    log.warn(
        "ManagerCorrelation-CAF - "
        + "ADVERTENCIA: CSV y NERM se encuentran "
        + "activas simultaneamente. "
        + "Este escenario no deberia ocurrir "
        + "segun la regla de negocio."
    );

    return returnMap;
}


return returnMap;

]]>

"

Hi María,

Just to confirm, have you attached the rule to the sources yet? Deploying it doesn’t turn it on automatically. A ManagerCorrelation rule only runs once it is referenced on the source, and there’s no UI field for that, so it has to be set through the API on both CSV and NERM. Something like this:

PATCH /v3/sources/{sourceId}
Content-Type: application/json-patch+json

[
  {
    "op": "replace",
    "path": "/managerCorrelationRule",
    "value": { "type": "RULE", "id": "<rule id>", "name": "<rule name>" }
  }
]

If you run GET /v2026/sources/{sourceId}, is managerCorrelationRule populated or null?

Also, the log.warn output is only visible to sailpoint and you need a ticket to extract it. Have you tried asking support which ManagerCorrelation-CAF lines were logged for a specific identity and aggregation? Your logging is detailed enough that the last line written would show which branch the rule took.

Thank you for your response.

Yes, I configured the Manager Correlation Rule on both connectors that are being used as authoritative sources. I have attached a screenshot showing how the configuration currently looks.

I have one additional question: in the Manager Correlation section of each connector, should an account attribute also be configured for manager correlation, or should that field be left empty when a Manager Correlation Rule is being used?

Currently, the same rule is assigned to both authoritative sources.

Thank you very much for your help!

Thanks María, the rule reference looks correct.

On the mapping: the rule documentation says the rule runs before the configured manager correlation mapping, so leaving managerCorrelationMapping null is fine. I’d keep it null while you debug. That way any manager that shows up can only have come from the rule, not from a fallback mapping.

Since the rule is attached, a few questions to narrow it down:

  1. Did you run the aggregation with Disable Optimization ticked after attaching the rule? With optimization on, accounts that haven’t changed since the last run are skipped, so the rule isn’t evaluated again for them.
  2. Is the manager identity attribute mapped in both identity profiles? Manager correlation feeds that attribute, so it’s worth checking the profiles as well as the sources.
  3. For a test identity that has both accounts, what does isDisabled() return on the CSV account? A delimited file account only reports as disabled if a column is mapped to IIQDisabled. If CSV accounts always read as active, anyone with an active NERM account ends up in your “both active” branch, which returns an empty map. RDK tests wouldn’t catch this because the links are mocked.
  4. Have you tried testing with an identity that only has a CSV account? That takes case 1, which reads the Manager attribute directly. If even that identity gets no manager after an unoptimized aggregation, the problem is invocation or configuration. If it does get one, look at the branching logic for identities with two accounts.

Also, not that anyone can do much with the rule id in your screenshot but a thicker pen would be more useful to your censorship attempts :stuck_out_tongue:

Thank you for your response. I’ll answer your questions below:

  1. Did you run the aggregation with “Disable Optimization” checked after attaching the rule?
    Yes. Optimization is not enabled, so I am running a full aggregation.
  2. Is the manager identity attribute mapped in both Identity Profiles?
    Yes. In both sources I have the corresponding attributes configured to identify the manager.
  • In the CSV source, the manager attribute contains the manager’s person_id.
  • In NERM, the erc_ne_attribute contains the manager’s uid.
  1. For a test identity that has both accounts, what does the CSV account return?
    In the CSV source I have a status attribute, which is used in the Lifecycle State configuration of the Identity Profile. This way, when the status represents a termination, the account is set to Terminated and the identity also becomes inactive.
  2. Have you tested with an identity that only has a CSV account?
    Yes. When the identity only has a CSV account, the manager is correctly obtained from CSV. If the identity only has a NERM account, the manager is also correctly obtained from NERM.

The issue appears when the identity has both accounts. Based on the tests I have performed, the manager seems to remain associated with the first authoritative account that was used to create the identity. After that, even if I change the account states so that one becomes active and the other inactive, the manager still remains the one from the first source.

For example:

  • If the identity is created first from CSV and NERM is added later, it continues showing the CSV manager.
  • If the identity is created first from NERM and CSV is added later, it continues showing the NERM manager.

Because of this, my question is whether the ManagerCorrelation Rule is re-evaluated and replaces an already correlated manager when the source that should provide the manager changes, or whether there is any additional configuration required to force that re-evaluation.

Thanks María, that narrows it down to the two-account branches, since the single-account cases work.

I think the answer is in how the CSV account’s state is read. You mentioned the CSV status column drives the lifecycle state. That changes the identity’s state, but not the account’s. For a delimited file source, the connector documentation says the account is enabled or disabled through the IIQDisabled attribute: “a Boolean attribute to set an account as enabled or disabled in Identity Security Cloud.” If there’s no IIQDisabled column in the file or schema, csvLink.isDisabled() returns false even for a terminated person.

In your rule, that means an identity with a terminated CSV record and an active NERM account never reaches case 5. It lands in the defensive “both active” branch and returns an empty map, so no new manager is ever supplied. That matches what you describe.

Could you check whether IIQDisabled is in the CSV account schema? If it isn’t, you have two options:

  1. Add IIQDisabled to the source (as a file column, or derived from status with a BuildMap rule, as the same page describes).
  2. Make the rule read csvLink.getAttribute("status") instead of calling isDisabled().

The same question applies to the NERM Persona account: does its inactive state actually show up as a disabled account in ISC? If not, the NERM checks need the same change.

Hello, good afternoon. I think I may not have explained the scenario clearly before.

I am attaching screenshots of accounts from both connectors. As you can see, when the Lifecycle State changes to Terminated, the identity status becomes inactive and the accounts associated with that identity appear as disabled.

Based on this information, do you still think the issue could be related to the account status?

What I am observing in my tests is that once the manager from the first authoritative source account that creates the identity is assigned, that manager remains set and is not updated afterward when the active account changes.

Because of this, I am wondering whether the issue could be that the ManagerCorrelation Rule is not being executed again after the initial processing. Could that be the case?

Hello María. From your screenshots, isDisabled() does not appear to be the issue. The CSV account is clearly disabled, and since you confirmed optimization is disabled for your test aggregation, manager correlation should be recalculated even for accounts without data changes.

To your question, the rule is not limited to the initial assignment. Manager correlation is recalculated during aggregation and identity processing. One documented behavior that could make it look like the rule was skipped is: “when an account attribute’s value changes and cannot be correlated to a new manager, the identity will remain correlated to their existing manager.” So it is possible for the rule to run while the old manager remains if the returned value cannot be correlated.

As a first test, on one affected identity, after both account states are correct, try Actions > Process Identity. Identity processing “determines the identity’s correct manager through manager correlation.” If the manager updates, that confirms manager correlation can produce the expected result during identity processing. If it does not, we still need to determine whether the rule was invoked, which branch ran, and what value it returned.

At that point, I would suggest opening a Support ticket rather than changing the rule further. Your rule already logs the branch and value under ManagerCorrelation-CAF, and cloud-rule logs are only visible to SailPoint. For Serrano, you could ask Support to confirm whether it reaches CASO 5:

csvLink.isDisabled() && !nermPersonaLink.isDisabled()

where the manager comes from erc_ne_attribute, and what identityAttributeValue