# Generic Rule - identity as input

**URL:** <https://developer.sailpoint.com/discuss/t/generic-rule-identity-as-input/23931>\
**Category:** SHF Discussion and Questions\
**Tags:** sailpoint-identity-security\
**Created:** [January 10, 2024, 10:18am UTC](https://developer.sailpoint.com/discuss/t/generic-rule-identity-as-input/23931 "2024-01-10T10:18:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RAKGDS](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/rakgds/32/2795_2.png) [@RAKGDS](https://developer.sailpoint.com/discuss/u/RAKGDS)\
**Post date:** [January 10, 2024, 10:18am UTC](https://developer.sailpoint.com/discuss/t/generic-rule-identity-as-input/23931/1 "2024-01-10T10:18:19Z")

</div>

Hi Team,  
I am working on created an Generic Rule. The purpose of this rule is to concatenate the values from account to the identity. I am not sure how to pass the identity attribute in the rule. I am directly refering the attirbute in the rule but when i use the validator utility it gives me the below error

Line 25 - [LintBSHMethodInvocation(93)] null Exception: Could not retrieve definition for variable name ‘identity’  
25: List multValAttr = ( List ) idn .getRawAccountAttribute ( cloudSourceName , identity .getName ( ) , attributeName )

How can we pass the identity as an object in the rule to make this work ?

@tyler_mairose : Could you please help here?

---

<div class="post-metadata">

**Author:** ![RAKGDS](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/rakgds/32/2795_2.png) [@RAKGDS](https://developer.sailpoint.com/discuss/u/RAKGDS)\
**Post date:** [January 12, 2024, 5:16pm UTC](https://developer.sailpoint.com/discuss/t/generic-rule-identity-as-input/23931/2 "2024-01-12T17:16:04Z")

</div>

Hi Team,  
Any help on this is much appreciated

---

<div class="post-metadata">

**Author:** ![nsorlien](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nsorlien](https://developer.sailpoint.com/discuss/u/nsorlien)\
**Post date:** [January 12, 2024, 6:12pm UTC](https://developer.sailpoint.com/discuss/t/generic-rule-identity-as-input/23931/3 "2024-01-12T18:12:24Z")

</div>

There’s a note in the guide bundled with the [validator](https://community.sailpoint.com/t5/Professional-Services/IdentityNow-Rule-Validator/ta-p/166116) zip that details how to do this:

> Generic rules may need additional objects adding to the Signature. The next example shows that “identity” of type “sailpoint.object.Identity” is injected into the BeanShell script for linting:

```xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule name="Test" >
  <Description>Designed to generate mail for active directory. </Description>
  <Signature returnType="Object">
  <Inputs>
    <Argument name="identity" type="sailpoint.object.Identity">
      <Description>
        Identity object type pushed into this rule... note the "type" attribute is set
        to "sailpoint.object.Identity", if not type is specified the Linter will "assume"
        this is of type "string".
        </Description>
    </Argument>
  </Inputs> 
  </Signature>
  <Source><![CDATA[
	log.debug("Identity name: " + identity.getName());
]]></Source>
</Rule>

```

---

<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:** [March 12, 2024, 6:12pm UTC](https://developer.sailpoint.com/discuss/t/generic-rule-identity-as-input/23931/4 "2024-03-12T18:12:44Z")

</div>

Closed on March 12, 2024, 6:12pm UTC

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