# Manager correlation rule in ISC

**URL:** <https://developer.sailpoint.com/discuss/t/manager-correlation-rule-in-isc/57292>\
**Category:** SHF Discussion and Questions\
**Tags:** identity-security-cloud, rules\
**Created:** [May 20, 2024, 1:25pm UTC](https://developer.sailpoint.com/discuss/t/manager-correlation-rule-in-isc/57292 "2024-05-20T13:25:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandramohans27](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@chandramohans27](https://developer.sailpoint.com/discuss/u/chandramohans27)\
**Post date:** [May 20, 2024, 1:25pm UTC](https://developer.sailpoint.com/discuss/t/manager-correlation-rule-in-isc/57292/1 "2024-05-20T13:25:58Z")

</div>

Hi Experts,

I’m writing a manager correlation rule where an account attribute is multivalued. I’m fetching the first value and need to check whether the associated identity LCS is active, if yes, map to the identity else look for its manager’s LCS and assign to its manager.

Need to perform the lookup until identity with active LCS is found. Can someone help me with this usecase

Account attribute : spn\_owners [multivalued]  
example :

```auto
"spn_owners": [
            "Priya K:e79c3f56-feba-4a45-b5d8-0f3c8f6a0040",
            "Praveenkumar H:1c5af482-fe4d-4bdb-a3e9-6b04c0751102"
        ]

Identity attribute : objectID
example : e79c3f56-feba-4a45-b5d8-0f3c8f6a0040

here is the basic rule which i have written.

String spnType = link.getAttribute("spn_servicePrincipalType");
  String spnOwners = link.getAttribute("spn_owners");

  String finalValue = "";
  
  Map returnMap = new HashMap();

  if(spnType != null && spnType == "Application){
  if((spnOwners != null) && (spnOwners.size() > 0)){
  if(spnOwners.contains(":")){
    finalValue= spnOwners.substring(spnOwners.lastIndexOf(":"),spnOwners.length());
  }

  }
  }

  finalValue=finalValue.trim();
  
  returnMap.put( "identityAttributeName", "trFedrampObjectid");
  returnMap.put( "identityAttributeValue", finalValue );
  
  return returnMap;

```

---

<div class="post-metadata">

**Author:** ![ashutosh08](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ashutosh08/32/11459_2.png) [@ashutosh08](https://developer.sailpoint.com/discuss/u/ashutosh08)\
**Post date:** [May 20, 2024, 2:32pm UTC](https://developer.sailpoint.com/discuss/t/manager-correlation-rule-in-isc/57292/2 "2024-05-20T14:32:46Z")

</div>

Just a modified version of your snippet with assumption that you are using cloud rule and username is being kept in your multi valued attribute and lifecycle state is as I named it. Similarly you may change it depending upon your use case.

```auto
if(spnType != null && spnType == “Application){
	if((spnOwners != null) && (spnOwners.size() > 0)){
		if(spnOwners.contains(":")){
		finalValue= spnOwners.substring(spnOwners.lastIndexOf(":"),spnOwners.length());
		
		do
		{
			List identityList=idn.findIdentitiesBySearchableIdentityAttribute("username","Equals",finalValue,"username");
identity=identityList.get(0);
			if(identity.getAttribute("cloudLifeCycleState")!=null && identity.getAttribute("cloudLifeCycleState").equals("active"))
			{
				finalValue=identity.getAttribute("username");
				break;
			}
		}while(identity!=null && identity.getAttribute("cloudLifeCycleState")!=null && identity.getAttribute("cloudLifeCycleState")!="active");
		if(identity!=null)
		{
			
		}
		}

	}
}

```

---

<div class="post-metadata">

**Author:** ![chandramohans27](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@chandramohans27](https://developer.sailpoint.com/discuss/u/chandramohans27)\
**Post date:** [May 20, 2024, 4:28pm UTC](https://developer.sailpoint.com/discuss/t/manager-correlation-rule-in-isc/57292/3 "2024-05-20T16:28:54Z")

</div>

@ashutosh08

Thankyou for your reply!

This helps me… In this above snippet, I think we have not covered the logic to find the manager’s lifecycle state when the Identity is “not active”

---

<div class="post-metadata">

**Author:** ![chandramohans27](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@chandramohans27](https://developer.sailpoint.com/discuss/u/chandramohans27)\
**Post date:** [May 20, 2024, 5:00pm UTC](https://developer.sailpoint.com/discuss/t/manager-correlation-rule-in-isc/57292/4 "2024-05-20T17:00:03Z")

</div>

@ashutosh08

to check for manager’s life cycle state, I have add the below condition in the while loop.

```auto
do
	{
		List identityList=idn.findIdentitiesBySearchableIdentityAttribute("trFedrampObjectid","Equals",finalValue,"trFedrampObjectid");

	identity=identityList.get(0);
	if(identity.getAttribute(“cloudLifeCycleState”)!=null && identity.getAttribute(“cloudLifeCycleState”).equals(“active”))
	{
	finalValue=identity.getAttribute(“trFedrampObjectid”);
	break;
	}
	}while(identity.getManager() !=null && identity..getManager().getAttribute(“cloudLifeCycleState”)!=null && identity..getManager().getAttribute(“cloudLifeCycleState”)!=“active”);

```

---

<div class="post-metadata">

**Author:** ![ashutosh08](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ashutosh08/32/11459_2.png) [@ashutosh08](https://developer.sailpoint.com/discuss/u/ashutosh08)\
**Post date:** [May 21, 2024, 4:45am UTC](https://developer.sailpoint.com/discuss/t/manager-correlation-rule-in-isc/57292/5 "2024-05-21T04:45:15Z")

</div>

Thanks for pointing out.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [July 20, 2024, 4:45am UTC](https://developer.sailpoint.com/discuss/t/manager-correlation-rule-in-isc/57292/6 "2024-07-20T04:45:54Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
