# Update account attribute in after operation rule

**URL:** <https://developer.sailpoint.com/discuss/t/update-account-attribute-in-after-operation-rule/71519>\
**Category:** IIQ Discussion and Questions\
**Tags:** webservice-connector, identityiq\
**Created:** [July 9, 2024, 8:13am UTC](https://developer.sailpoint.com/discuss/t/update-account-attribute-in-after-operation-rule/71519 "2024-07-09T08:13:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![massinissa](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@massinissa](https://developer.sailpoint.com/discuss/u/massinissa)\
**Post date:** [July 9, 2024, 8:13am UTC](https://developer.sailpoint.com/discuss/t/update-account-attribute-in-after-operation-rule/71519/1 "2024-07-09T08:13:32Z")

</div>

### Which IIQ version are you inquiring about?

Version 8.X

### Share all details related to your problem, including any error messages you may have received.

Hi ,

Due to a specific need we need to update an account attribute , is it possible to do it throught an after rule ?

for example if i get the accoutn with :

`Link l = (Link) context.getUniqueObject(Link.class, Filter.and(Filter.eq("application.name", "appname"),Filter.eq("nativeIdentity", "XXXXXX")));`

how can i update a multivalued attribute by replacing its old value ?

Thanks

---

<div class="post-metadata">

**Author:** ![enistriminsait](https://avatars.discourse-cdn.com/v4/letter/e/58f4c7/32.png) [@enistriminsait](https://developer.sailpoint.com/discuss/u/enistriminsait)\
**Post date:** [July 9, 2024, 8:49am UTC](https://developer.sailpoint.com/discuss/t/update-account-attribute-in-after-operation-rule/71519/2 "2024-07-09T08:49:19Z")

</div>

Hi @massinissa,

yes you can use this method for searching an account or other(search, getObject, read from plan…).  
A multivalued attribute is list of object, so you need create a list/array of the same type and put into attribute with setAttribute().

little question: Are you sure to change an account attribute in the after? with this, you have a value in SP for this attribute and another value in the target system

---

<div class="post-metadata">

**Author:** ![massinissa](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@massinissa](https://developer.sailpoint.com/discuss/u/massinissa)\
**Post date:** [July 9, 2024, 9:02am UTC](https://developer.sailpoint.com/discuss/t/update-account-attribute-in-after-operation-rule/71519/3 "2024-07-09T09:02:47Z")

</div>

Hi,

Yes, we change the attribut value in SP with the actual value of the target system , which needs some processing ,

Thanks

---

<div class="post-metadata">

**Author:** ![enistriminsait](https://avatars.discourse-cdn.com/v4/letter/e/58f4c7/32.png) [@enistriminsait](https://developer.sailpoint.com/discuss/u/enistriminsait)\
**Post date:** [July 9, 2024, 9:06am UTC](https://developer.sailpoint.com/discuss/t/update-account-attribute-in-after-operation-rule/71519/4 "2024-07-09T09:06:21Z")

</div>

ok, I understand.

So I think is better a CustomizationRule, there you have the link and you can work directly before the end of operation.  
Is present a variable called object where you find the link

---

<div class="post-metadata">

**Author:** ![dylanfoggan](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/dylanfoggan/32/13658_2.png) [@dylanfoggan](https://developer.sailpoint.com/discuss/u/dylanfoggan)\
**Post date:** [July 9, 2024, 11:00am UTC](https://developer.sailpoint.com/discuss/t/update-account-attribute-in-after-operation-rule/71519/5 "2024-07-09T11:00:10Z")

</div>

Hi @massinissa ,

I am just trying to understand why there is a need to update the account attribute in an AfterOperationRule and not directly in the operation request body.

If the request being sent is not updating the account attribute, could you perhaps confirm the reason for this?

regards,

---

<div class="post-metadata">

**Author:** ![vishal\_kejriwal1](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vishal_kejriwal1/32/10904_2.png) [@vishal\_kejriwal1](https://developer.sailpoint.com/discuss/u/vishal_kejriwal1)\
**Post date:** [July 9, 2024, 12:44pm UTC](https://developer.sailpoint.com/discuss/t/update-account-attribute-in-after-operation-rule/71519/6 "2024-07-09T12:44:01Z")

</div>

It’s better to use before provisioning rule if you want to update attribute for same application .  
All the operation will be serviced in one call and it would be easy for you to catch for any error or exception .

---

<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:** [July 9, 2024, 4:07pm UTC](https://developer.sailpoint.com/discuss/t/update-account-attribute-in-after-operation-rule/71519/7 "2024-07-09T16:07:48Z")

</div>

Hi @massinissa,

Ideally you should not be updating Link object directly.

Is there any specific case where you want to update the attribute which is just in SailPoint and not in target system?

If yes, then if you after provisioning/operation rule is present then you use that.

Please find the sample code for link changes. Feel free to make changes in the same.

```auto
List attributeList=(List) l.getAttribute("AttributeName");
		attributeList.add("New Value");
		
		l.setAttribute("AttributeName",attributeList);
		SailPointFactory.getCurrentContext().saveObject(l);
		SailPointFactory.getCurrentContext().commitTransaction();

```

If you want to do it in customization rule, then please use object available to check for account type object.

If there is any further question, then let us know the same.

Thanks

---

<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:** [September 7, 2024, 4:08pm UTC](https://developer.sailpoint.com/discuss/t/update-account-attribute-in-after-operation-rule/71519/8 "2024-09-07T16:08:13Z")

</div>

Closed on September 7, 2024, 4:08pm UTC

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