---
schema: rendered-html/v1
title: "400 Bad Request When Adding a Custom Field Value to a Set | Developer Portal for YouTrack and Hub Documentation"
source_url: https://www.jetbrains.com/help/youtrack/devportal/api-troubleshoot-incorrect-request-url.html
generated_at: 2026-06-11T15:00:35.638404+00:00
---

Feedback

Thanks for your feedback!

Was this page helpful?

YesNo

Developer Portal for YouTrack and Hub

- Developer Portal
- Apps
- MCP Tools
- YouTrack Workflows
- YouTrack Import Scripts
- YouTrack Form API
- YouTrack REST API
- Get Started with REST API
- REST API Reference
- [REST API Use Cases](jetbrains__com__help__youtrack__devportal__api-use-cases.md)
- [REST API Troubleshooting](jetbrains__com__help__youtrack__devportal__api-troubleshooting.md)
- [400 Bad Request When Adding a Custom Field Value to a Set](api-troubleshoot-incorrect-request-url.html)
- [400 Bad Request When Creating an Issue Without Required Field Value](jetbrains__com__help__youtrack__devportal__api-troubleshoot-missing-type.md)
- [400 Bad Request When Updating a Conditional Field](jetbrains__com__help__youtrack__devportal__api-troubleshoot-updating-conditional-field.md)
- [500 Server Error When Updating a Custom Field](jetbrains__com__help__youtrack__devportal__api-troubleshoot-incorrect-field-type.md)
- [500 Server Error When Adding a Field to a Project](jetbrains__com__help__youtrack__devportal__api-troubleshoot-custom-field-prototype.md)
- Color Indices List
- Hub REST API

1. YouTrack REST API
2. [REST API Troubleshooting](jetbrains__com__help__youtrack__devportal__api-troubleshooting.md)
3. [400 Bad Request When Adding a Custom Field Value to a Set](#0)

# 400 Bad Request When Adding a Custom Field Value to a Set﻿

Last modified: 07 May 2026

This article examines an error that might occur when you update a set of values (bundle) using YouTrack REST API. You can face this error while figuring out the correct URL to access a specific bundle for a project custom field.

## Error Message﻿

{
    "error": "Bad Request",
    "error_description": "Entity id 70-519 refers to entity of type BundleProjectCustomField, while entity of type ProjectVersionsBundle is expected"
}

## Request Details﻿

Here are the details about a sample request that might result in this error.

| Attribute | Value |
| --- | --- |
| Request method | POST |
| Endpoint | `/api/admin/customFieldSettings/bundles/version/versionBundleID/values` |
| Request body | ``` {     "name": "October sprint",     "$type": "VersionBundleElement" } ``` |
| HTTP response code | 400 |

## Use Case﻿

You want to add a value to a bundle in a project custom field. You've decided to do this by accessing the bundle from the global list of bundles.

You have tried to figure out the ID of the target bundle and define the correct endpoint for the POST request. However, instead of the ID of the bundle, you've used the ID of the project custom field prototype in the request URL.

To define the correct request URL, you need to determine the ID of the target bundle. If you send a GET request to `/admin/projects/projectID/customFields?fields=id,field(name,fieldType),project(shortName),bundle(id,name)`, here's the response body:

...,
{
  "bundle": {
    "name": "New Project: Versions",
    "id": "59-2",
    "$type": "VersionBundle"
  },
  "field": {
    "name": "Affected versions",
    "fieldType": {
      "$type": "FieldType"
    },
    "$type": "CustomField"
  },
  "project": {
    "shortName": "NP",
    "$type": "Project"
  },
  "id": "82-13",
  "$type": "VersionProjectCustomField"
},
...

Now, if you take ID `82-13` (the ID of the project custom field prototype) and use it instead of the bundle ID (`59-2`), you will get the error described in this article.

## Troubleshooting﻿

Here are some possible causes and suggestions on how to overcome this error and add a value to the target set.

### Cause﻿

The ID of the target bundle used in the request URL is incorrect.

### Solution 1﻿

Replace the ID of the project custom field with `59-2`, which is the ID of the target bundle, in the request URL.

To locate the ID of the target bundle, look at the structure of the response body that you received from the GET request. You get a collection of project custom fields with their attributes in the response. The `bundle` attribute is one of the attributes of the `ProjectCustomField` entity. You can find the ID of the bundle inside the `bundle` object.

Each custom field in a project has its ID. In our example, this ID is `82-13`. You can use this ID in those requests that update this project custom field.

In this case, you want to update the bundle that's attached to this project custom field, so you need to use the ID of the bundle. You can find the ID of the bundle in the response to the GET request on the same level as the type of the bundle: `"$type": "VersionBundle"`. When you're unsure which ID to use, consider the entity type as your safety net.

The error message indicates that in this particular request, YouTrack expects an entity of the `ProjectVersionsBundle` type instead of `BundleProjectCustomField`.

The final request URL in this case would be `/api/admin/customFieldSettings/bundles/version/59-2/values` where `59-2` is the ID of the target bundle.

For more details about custom field hierarchy in the YouTrack REST API, see Custom Fields in REST API.

### Solution 2﻿

Change the endpoint and work with the bundle of the particular custom field in the project instead of the global list of bundles.

The updated endpoint would be `/api/admin/projects/projectID/customFields/projectCustomFieldID/bundle/values`. This resource lets you access the bundle of a particular custom field in a specific project.

To compose the URL for a valid request, you need the ID of the project and the ID of the project custom field. To get the ID of the project, make a GET request to the global list of projects. As for the ID of the project custom field, it's `82-13` from the initial request.

The final request URL in this case would be `/api/admin/projects/81-1/customFields/82-13/bundle/values` where `81-1` is the ID of the target project, and `81-1` is the ID of the target bundle.

- [400 Bad Request When Adding a Custom Field Value to a Set](/help/youtrack/devportal/api-troubleshoot-incorrect-request-url.html)
- [Error Message](/help/youtrack/devportal/api-troubleshoot-incorrect-request-url.html#error-message)
- [Request Details](/help/youtrack/devportal/api-troubleshoot-incorrect-request-url.html#request-details)
- [Use Case](/help/youtrack/devportal/api-troubleshoot-incorrect-request-url.html#use-case)
- [Troubleshooting](/help/youtrack/devportal/api-troubleshoot-incorrect-request-url.html#troubleshooting)

[REST API Troubleshooting](jetbrains__com__help__youtrack__devportal__api-troubleshooting.md)[400 Bad Request When Creating an Issue Without Required Field Value](jetbrains__com__help__youtrack__devportal__api-troubleshoot-missing-type.md)

- Privacy & Security
- Terms Of Use
- Trademarks
- Legal

Copyright © 2000–2026 JetBrains s.r.o.
