Terminated Users with Active Account

Which IIQ version are you inquiring about? 8.4P1

Hi Team, I am creating report for terminated user with Active accounts but its always throwing Null Pointer exception, IIQDisabled attribute is not working. Code are below

                  import sailpoint.object.QueryOptions;
                  import sailpoint.object.Filter;
                  import sailpoint.object.Link;
                  import sailpoint.tools.GeneralException;

                  QueryOptions queryOptions = new QueryOptions();
                  queryOptions.addFilter(Filter.eq("id.status", "T"));
                 
                  try {
                   
                    Filter subquery = Filter.subquery("name", Link.class, "identity.id", Filter.and(Filter.eq("attributes.IIQDisabled",false), Filter.eq("application", "Oracle ERP Test")));
                    queryOptions.addFilter(subquery);
                  } catch (Exception e) {
                    log.error("Subquery filter skipped due to mapping issue: " + e);
                  }

                  return queryOptions;

                </Source>
              </QueryScript>
            </Parameter>
          </QueryParameters>
        </DataSource>

Thanks!

Hi @BSingh2,

i dont know if the other parts are correct but the attribute is iiqDisabled, not IIQDisabled. Try to change.

tried with iiqDisabled also but no luck!

Hey @BSingh2 ,

It looks like your subquery structure is slightly off. You need to compare Identity.id with Link.identity.id, use application.name (not the Application object). Try this version:


Filter subquery = Filter.subquery(
    "id",                      // Identity id
    sailpoint.object.Link.class,
    "identity.id",             // Link’s identity reference
    Filter.and(
        Filter.eq("iiqDisabled", false),      // active link
        Filter.eq("application.name", "Oracle ERP Test")
    )
);

Thanks

Thank you, I tried with above code but getting same NullPointer Execption-

import sailpoint.object.QueryOptions;
import sailpoint.object.Filter;
import sailpoint.object.Link;
import sailpoint.tools.GeneralException;

                  QueryOptions queryOptions = new QueryOptions();
                  queryOptions.addFilter(Filter.eq("id.Status", "T"));
                  Filter subquery = Filter.subquery(
                  "id",                      // Identity id
                  sailpoint.object.Link.class,
                  "identity.id",             // Link’s identity reference
                  Filter.and(
                      Filter.eq("iiqDisabled", false),      // active link
                      Filter.eq("application.name", "Oracle ERP Test")
                  )
                 );

                  return queryOptions;

@BSingh2

Please try the below code:

import sailpoint.object.QueryOptions;
import sailpoint.object.Filter;
import sailpoint.object.Link;
import sailpoint.tools.GeneralException;

// Create main query options
QueryOptions queryOptions = new QueryOptions();

// Subquery: Get Identities where status = 'T'
Filter idStatusFilter = Filter.subquery(
    "identity.id",                   // property on Link object
    sailpoint.object.Identity.class, // object type in subquery
    "id",                            // match Identity.id
    Filter.eq("status", "T")         // condition on Identity
);

// Main filter: Active Link + specific application + valid identity
Filter mainFilter = Filter.and(
    Filter.eq("iiqDisabled", false),
    Filter.eq("application.name", "Oracle ERP Test"),
    idStatusFilter
);

// Attach the filter to query options
queryOptions.addFilter(mainFilter);

return queryOptions;