# Get a List of Issues with All Values

Use the REST API to get a list of issues with their custom field values.

## Summary

To get a list of issues with their custom field values:

1. Use the [Read a List of Issues](resource-api-issues.html) request:

```CURL
GET /api/issues?[fields]
```

2.  In the `fields` parameter, specify the issue attributes that you want to return, including the relevant attributes of `customFields`.

3.  Optionally, use the `query` request parameter to filter the issue list.

## Step-by-Step

Start with a request for a single issue and its custom fields, then use the same pattern for the issues list.

### Get an Issue with Its Custom Fields

Procedure:

1. To get an issue with values of all its custom fields, send a `GET` request to the target issue. You can reference the issue by its `idReadable` value, for example `SP-8`, or by its entity `id`, for example `2-7`.

```CURL
GET /api/issues/{issueID}?[fields]
```

[Read more about operations with an issue](operations-api-issues.html).

2. The `fields` request parameter is the comma-separated list of attributes to return for the requested entity. In this example, the entity is `Issue`.

You can request any set of supported attributes of the returned entity. For an issue, see [the list of supported attributes](api-entity-Issue.html).

In this how-to, we request the following data:

```CURL
fields=id,idReadable,summary,customFields(id,projectCustomField(field(name)),value(name,login,fullName))
```

* `$type` — the entity type. YouTrack returns the `$type` for all entities in the response regardless of whether you specify it in the request explicitly or not.

* `id` — a unique ID of the returned entity in the database.

* `idReadable` — the issue ID shown in the UI, for example `SP-8`.

* `summary` — the issue summary.

* `customFields` — an attribute of the returned `Issue` entity that contains a collection of the issue custom fields. This is the target of our how-to.

3. The `customFields(...)` expression is part of the `fields` parameter, not a separate query parameter. Here, we request the following attributes for each custom field:

```CURL
customFields(id,projectCustomField(field(name)),value(name,login,fullName))
```

* `projectCustomField` — each `IssueCustomField` contains settings of a `ProjectCustomField` in a particular issue.

* `field` — each `ProjectCustomField` contains settings of a `CustomField` in a particular project.

* `projectCustomField(field(name))` — returns the name of the custom field definition, for example `Priority`, `State`, or `Assignee`.

* `value` — stores the custom field value for the issue. Depending on the field type, it can contain a primitive value, a linked entity, or a collection of values.

[Read more about the custom field hierarchy](api-concept-custom-fields.html).

The final request is the following:

```CURL
curl -X GET \
'https://example.youtrack.cloud/api/issues/SP-8?fields=id,idReadable,summary,customFields(id,projectCustomField(field(name)),value(name,login,fullName))' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YouTrack_token>' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json'
```

The response looks like this:

In this example, the issue contains the following custom fields: `Priority`, `State`, `Assignee`, `Subsystem`, `Fix versions`, and `Fixed in build`.

```JSON
{
    "id":"2-7",
    "idReadable":"SP-8",
    "summary":"Issue from REST #1",
    "$type":"Issue",
    "customFields":[
        {
            "id":"92-1",
            "$type":"SingleEnumIssueCustomField",
            "projectCustomField":{
                "id":"92-1",
                "$type":"EnumProjectCustomField",
                "field":{
                    "id":"58-1",
                    "$type":"CustomField",
                    "name":"Priority"
                },
            },
            "value":{
                "id":"67-3",
                "$type":"EnumBundleElement",
                "name":"Normal"
            }
        },
        {
            "id":"92-3",
            "$type":"StateIssueCustomField",
            "projectCustomField":{
                "id":"92-3",
                "$type":"StateProjectCustomField",
                "field":{
                    "id":"58-3",
                    "$type":"CustomField",
                    "name":"State"
                }
            },
            "value":{
                "id":"69-7",
                "$type":"StateBundleElement",
                "name":"Fixed"
            }
        },
        {
            "id":"94-0",
            "$type":"SingleUserIssueCustomField",
            "projectCustomField":{
                "id":"94-0",
                "$type":"UserProjectCustomField",
                "field":{
                    "id":"58-4",
                    "$type":"CustomField",
                    "name":"Assignee"
                }
            },
            "value":{
                "id":"1-2",
                "$type":"User",
                "name":"John Doe",
                "fullName":"John Doe",
                "login":"john.doe"
            }
        },
        {
            "id":"92-0",
            "$type":"SingleOwnedIssueCustomField",
            "projectCustomField":{
                "id":"92-0",
                "$type":"OwnedProjectCustomField",
                "field":{
                    "id":"58-0",
                    "$type":"CustomField",
                    "name":"Subsystem"
                }
            },
            "value":{
                "id":"134-0",
                "$type":"OwnedBundleElement",
                "name":"Documentation"
            }
        },
        {
            "id":"92-4",
            "$type":"MultiVersionIssueCustomField",
            "projectCustomField":{
                "id":"92-4",
                "$type":"VersionProjectCustomField",
                "field":{
                    "id":"58-5",
                    "$type":"CustomField",
                    "name":"Fix versions"
                }
            },
            "value":[
                {
                    "id":"133-19",
                    "$type":"VersionBundleElement",
                    "name":"2019.1"
                }
            ]
        },
        {
            "id":"92-6",
            "$type":"SingleBuildIssueCustomField",
            "projectCustomField":{
                "id":"92-6",
                "$type":"BuildProjectCustomField",
                "field":{
                    "id":"58-7",
                    "$type":"CustomField",
                    "name":"Fixed in build"
                }
            },
            "value":{
                "id":"135-0",
                "$type":"BuildBundleElement",
                "name":"48733"
            },
        }
    ]
}
```

### Get a List of Issues with Custom Fields

To return the same data for multiple issues, remove the `{issueID}` from the endpoint URL. For example:

```CURL
curl -X GET \
'https://example.youtrack.cloud/api/issues?fields=id,summary,customFields(id,projectCustomField(field(name)),value(name))' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YouTrack_token>' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json'
```

To filter the list of returned issues, add the `query` parameter. For example, to return a subset of issues from a specific project:

```CURL
curl -X GET \
'https://example.youtrack.cloud/api/issues?fields=id,idReadable,summary,customFields(id,projectCustomField(field(name)),value(name))&query=in:SP' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YouTrack_token>' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json'
```

To get a single issue by its readable ID, request it directly, for example: `/api/issues/SP-8?fields=id,idReadable,summary,customFields(id,projectCustomField(field(name)),value(name))`.

For more information about supported search expressions, see [Query Syntax](api-query-syntax.html).

