# Removing component from issue via REST API

**URL:** <https://community.developer.atlassian.com/t/removing-component-from-issue-via-rest-api/49653>\
**Category:** Jira Cloud\
**Tags:** issue-update, jira-cloud, rest-api\
**Created:** [July 8, 2021, 11:33am UTC](https://community.developer.atlassian.com/t/removing-component-from-issue-via-rest-api/49653 "2021-07-08T11:33:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaweJakimiak](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@PaweJakimiak](https://community.developer.atlassian.com/u/PaweJakimiak)\
**Post date:** [July 8, 2021, 11:33am UTC](https://community.developer.atlassian.com/t/removing-component-from-issue-via-rest-api/49653/1 "2021-07-08T11:33:52Z")

</div>

Hello,

according to [documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put), I tried to remove component from an issue.

This is my request body:

```auto
{
    "update":{
        "components":[
            {
                "remove": [{"name": "Network"}]
            }
        ]
    }
}

```

but I’m receiving 400 error with following error message:

> “components”: “Can not deserialize instance of com.atlassian.jira.issue.fields.rest.json.beans.ComponentJsonBean out of START\_ARRAY token\n at [Source: N/A; line: -1, column: -1]”

What I doing wrong?

---

<div class="post-metadata">

**Author:** ![ibuchanan](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ibuchanan/32/35815_2.png) [@ibuchanan](https://community.developer.atlassian.com/u/ibuchanan)\
**Post date:** [July 8, 2021, 1:18pm UTC](https://community.developer.atlassian.com/t/removing-component-from-issue-via-rest-api/49653/2 "2021-07-08T13:18:40Z")

</div>

@PaweJakimiak,

I tried all the `update` verbs that I could find using [Jira Server API docs](https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/#adding-a-comment--examples), in the hopes the functionality hasn’t changed. Here’s what I found:

### `add`

Fails for both `name` and `id` with status 400 and this response:

```json
{
  "errorMessages": [],
  "errors": {
    "components": "Could not find valid 'id' or 'name' in component object."
  }
}

```

### `remove`

Fails for both `name` and `id` with status 400 and this response:

```json
{
  "errorMessages": [],
  "errors": {
    "components": "Can not deserialize instance of com.atlassian.jira.issue.fields.rest.json.beans.ComponentJsonBean out of START_ARRAY token\n at [Source: N/A; line: -1, column: -1]"
  }
}

```

That confirms what you found.

### `set`

Works for both `id` and `name`, responding with status 204.

In short, the `add` and `remove` verbs no longer work. I can only conclude that to change the set of components, your client must first ask for the list, modify it client-side, then send back the modification with a set. In which case, you might just as well use the `fields` attribute on the `PUT` request, instead of bothering with the more complicated `update` syntax with insufficiently documented verbs.

---

<div class="post-metadata">

**Author:** ![PaweJakimiak](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@PaweJakimiak](https://community.developer.atlassian.com/u/PaweJakimiak)\
**Post date:** [July 8, 2021, 1:24pm UTC](https://community.developer.atlassian.com/t/removing-component-from-issue-via-rest-api/49653/3 "2021-07-08T13:24:00Z")

</div>

Thank you @ibuchanan for confirmation. I’ll managed with fields attribute as you recommend.
