# State Bundles

This resource provides operations with sets of values of the
`state`
type.
|  Resource  |     ```GENERIC /api/admin/customFieldSettings/bundles/state ```    |
| --- | --- |
|  Returned entity  |  [StateBundle](api-entity-StateBundle.html). For the description of the entity attributes, see [Supported Fields](#StateBundle-supported-fields) section.  |
|  Supported methods  |      * `GET`: [Read a List of StateBundles](#get_all-StateBundle-method).    * `POST`: [Add a New StateBundle](#create-StateBundle-method).    |
|  Supported sub-resources  |      * [/api/admin/customFieldSettings/bundles/state/{bundleID}](operations-api-admin-customFieldSettings-bundles-state.html)    * [/api/admin/customFieldSettings/bundles/state/{bundleID}/values](resource-api-admin-customFieldSettings-bundles-state-bundleID-values.html)    |

## StateBundle attributes

Represents a set of states in YouTrack.

### Related Resources

Below you can find the list of resources that let you work with this entity.

* [State Bundles]()

Extends [BaseBundle](api-entity-BaseBundle.html)

### Attributes

This table describes attributes of the `StateBundle` entity.

* To receive an attribute in the response from the server, specify it explicitly in the `fields` request parameter.

* To update an attribute, provide it in the body of a POST request.

|  Field  |  Type  |  Description  |
| --- | --- | --- |
|  id  |  String  |  The ID of the set of states. `Read-only`.  |
|  values  |  [Array of StateBundleElements](api-entity-StateBundleElement.html)  |  The list of states that this set of values contains.  |
|  isUpdateable  |  Boolean  |  If `true`, then the currently logged-in user can update this bundle. Otherwise, `false`. `Read-only`.  |

## Read a List of StateBundles

Get all available sets of values of the State type.

### Request syntax

```GENERIC
GET /api/admin/customFieldSettings/bundles/state?{fields}&{$top}&{$skip}
```

|  null  |  The database ID of StateBundle  |
| --- | --- |

### Request parameters

|  Parameter  |  Type  |  Description  |
| --- | --- | --- |
|  fields  |  String  |  A list of StateBundle attributes that should be returned in the response. If no field is specified, only the `entityID` is returned.  |
|  $skip  |  Int  |  Optional. Lets you set a number of returned entities to skip before returning the first one.  |
|  $top  |  Int  |     Optional. Lets you specify the maximum number of entries that are returned in the response. If you don't set the $top value, the server limits the maximum number of returned entries.       The server returns a maximum of 42 entries for most resources that return collections. For more information, see [Pagination](api-concept-pagination.html).     |

### Sample

#### Sample request

```CURL
https://example.youtrack.cloud/api/admin/customFieldSettings/bundles/state?fields=name,id,values(name,id,ordinal,isResolved),isUpdateable&$top=2
```

#### Sample response body

```JSON
[
  {
    "values": [
      {
        "isResolved": false,
        "ordinal": 0,
        "name": "Submitted",
        "id": "69-0",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": false,
        "ordinal": 1,
        "name": "Open",
        "id": "69-1",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": false,
        "ordinal": 2,
        "name": "In Progress",
        "id": "69-2",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": false,
        "ordinal": 3,
        "name": "To be discussed",
        "id": "69-3",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": false,
        "ordinal": 4,
        "name": "Reopened",
        "id": "69-4",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": true,
        "ordinal": 5,
        "name": "Can't Reproduce",
        "id": "69-5",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": true,
        "ordinal": 6,
        "name": "Duplicate",
        "id": "69-6",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": true,
        "ordinal": 7,
        "name": "Fixed",
        "id": "69-7",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": true,
        "ordinal": 8,
        "name": "Won't fix",
        "id": "69-8",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": true,
        "ordinal": 9,
        "name": "Incomplete",
        "id": "69-9",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": true,
        "ordinal": 10,
        "name": "Obsolete",
        "id": "69-10",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": true,
        "ordinal": 11,
        "name": "Verified",
        "id": "69-11",
        "$type": "StateBundleElement"
      }
    ],
    "name": "States",
    "isUpdateable": true,
    "id": "68-0",
    "$type": "StateBundle"
  },
  {
    "values": [
      {
        "isResolved": false,
        "ordinal": 0,
        "name": "Open",
        "id": "69-12",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": false,
        "ordinal": 1,
        "name": "In Progress",
        "id": "69-13",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": false,
        "ordinal": 2,
        "name": "To Verify",
        "id": "69-14",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": true,
        "ordinal": 3,
        "name": "Done",
        "id": "69-15",
        "$type": "StateBundleElement"
      },
      {
        "isResolved": true,
        "ordinal": 4,
        "name": "Duplicate",
        "id": "69-16",
        "$type": "StateBundleElement"
      }
    ],
    "name": "Scrum project from RESTState18cac08b-eacb-4323-811d-f21c225e36f9",
    "isUpdateable": true,
    "id": "68-1",
    "$type": "StateBundle"
  }
]
```

## Add a New StateBundle

Create new set of values of the State type.

### Required permissions

Requires permissions: Update Project or Low-level Admin Write

### Request syntax

```GENERIC
POST /api/admin/customFieldSettings/bundles/state?{fields}
```

|  null  |  The database ID of StateBundle  |
| --- | --- |

### Request parameters

|  Parameter  |  Type  |  Description  |
| --- | --- | --- |
|  fields  |  String  |  A list of StateBundle attributes that should be returned in the response. If no field is specified, only the `entityID` is returned.  |

### Sample

#### Sample request

```CURL
https://example.youtrack.cloud/api/admin/customFieldSettings/bundles/state?fields=name,id,values(name,id,ordinal,isResolved),isUpdateable
```

#### Sample request body

```JSON
{
  "values": [
    {
      "isResolved": false,
      "name": "Reported"
    },
    {
      "isResolved": false,
      "name": "Investigation"
    },
    {
      "isResolved": false,
      "name": "Delegated"
    },
    {
      "isResolved": false,
      "name": "On hold"
    },
    {
      "isResolved": false,
      "name": "Investigated"
    },
    {
      "isResolved": false,
      "name": "Waiting for reply"
    },
    {
      "isResolved": false,
      "name": "Replied"
    },
    {
      "isResolved": false,
      "name": "Reply confirmed"
    },
    {
      "isResolved": true,
      "name": "Resolved"
    }
  ],
  "name": "ST States",
  "isUpdateable": true
}
```

#### Sample response body

```JSON
{
  "values": [
    {
      "isResolved": false,
      "name": "Reported",
      "id": "69-54",
      "$type": "StateBundleElement"
    },
    {
      "isResolved": false,
      "name": "Investigation",
      "id": "69-55",
      "$type": "StateBundleElement"
    },
    {
      "isResolved": false,
      "name": "Delegated",
      "id": "69-56",
      "$type": "StateBundleElement"
    },
    {
      "isResolved": false,
      "name": "On hold",
      "id": "69-57",
      "$type": "StateBundleElement"
    },
    {
      "isResolved": false,
      "name": "Investigated",
      "id": "69-58",
      "$type": "StateBundleElement"
    },
    {
      "isResolved": false,
      "name": "Waiting for reply",
      "id": "69-59",
      "$type": "StateBundleElement"
    },
    {
      "isResolved": false,
      "name": "Replied",
      "id": "69-60",
      "$type": "StateBundleElement"
    },
    {
      "isResolved": false,
      "name": "Reply confirmed",
      "id": "69-61",
      "$type": "StateBundleElement"
    },
    {
      "isResolved": true,
      "name": "Resolved",
      "id": "69-62",
      "$type": "StateBundleElement"
    }
  ],
  "name": "ST States",
  "isUpdateable": true,
  "id": "68-9",
  "$type": "StateBundle"
}
```

