# Update Assignment Rule

This call is used to change an assignment rule. The existing assignment rule for this field is a simple assignment from the customer view.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FgnUXkfXuogBWBws3Bjj3%2Fimage.png?alt=media&#x26;token=d52e16fa-ab61-499b-9209-d9b800bd5d79" alt=""><figcaption><p>Existing rule to be updated</p></figcaption></figure>

We will change the field being assigned, and add a condition to the rule.

This call is sent as a PATCH call.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FybDjhtxLCwVeTrwBg3Ei%2Fimage.png?alt=media&#x26;token=ab3549a9-59a8-4ed8-8809-39f4338698cb" alt=""><figcaption><p>Update rule call</p></figcaption></figure>

The body of the call contains the information being sent to update the rule.  The project and workset are sent to set the context.  The entity is sent using the rule ID from the Get Assignment Rules call (67ea97d49df32c722419d903) to point to the specific rule being updated.  Finally, the call contains the operand and conditions to be sent (using the same format as when creating a rule with operands and conditions).

&#x20;

```
{
    "context": {
        "user": "user_ID",
        "password": "xxxx",
        "project": {
            "name": "imp_payments_demo",
            "version": "1.0"
        },
        "workSet": {
            "name": "api_2_workset",
            "version": "1.1"
        }
    },
    "entity": {
        "id": "67ea97d49df32c722419d903",
        "operands": [
            {
                "operator": "ASSIGN",
                "value": {
                    "name": "acts_view",
                    "version": "1.0",
                    "attribute": "account_type"
                }
            }  
        ],
      "conditions": [
            {
                "operand": {
                    "name": "format_cov_view",
                    "version": "1.0",
                    "attribute": "currency_a"
                },
                "operator": "EQUAL",
                "value": "USD"
            }
        ]  
    }
}
```

&#x20;

The return message contains the information on the updated rule.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FZ0kpNcQaXrqJbhPUDvRB%2Fimage.png?alt=media&#x26;token=f7712130-dfc8-4806-83ef-4492b8def3bc" alt=""><figcaption><p>Return message with upated rule </p></figcaption></figure>

TDO now reflects the updated rule. The view and field being assigned are updated and the condition is now there as well.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2F7Igc5XCmJNZHEIS4JoCM%2Fimage.png?alt=media&#x26;token=f45ffbb8-b04d-49ac-8352-a7c5abc12f49" alt=""><figcaption><p>Updated rule in TDO</p></figcaption></figure>
