---
schema: rendered-html/v1
title: "500 Server Error When Updating a Custom Field | Developer Portal for YouTrack and Hub Documentation"
source_url: https://www.jetbrains.com/help/youtrack/devportal/api-troubleshoot-incorrect-field-type.html
generated_at: 2026-06-11T15:00:23.872576+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](jetbrains__com__help__youtrack__devportal__api-troubleshoot-incorrect-request-url.md)
- [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](api-troubleshoot-incorrect-field-type.html)
- [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. [500 Server Error When Updating a Custom Field](#0)

# 500 Server Error When Updating a Custom Field﻿

Last modified: 07 May 2026

This article examines an error that might occur when you update a custom field in an issue using YouTrack REST API.

You can face this error while making requests to different endpoints. This topic describes the most common scenario when you can receive this error message.

## Error Message﻿

<class 'requests.exceptions.HTTPError'> - 500 Server Error:
Internal Server Error for url: https://example.myjetbrains.com/youtrack/api/issues/YT-6966
error: server_error
error_description: class jetbrains.charisma.customfields.complex.state.
StateProjectCustomFieldMegaProxy cannot be cast to class jetbrains.charisma.persistence.
customfields.IssueCustomField (jetbrains.charisma.customfields.complex.state.
StateProjectCustomFieldMegaProxy and jetbrains.charisma.persistence.customfields.
IssueCustomField are in unnamed module of loader org.eclipse.jetty.webapp.
WebAppClassLoader @7ec9161f)

## Request Details﻿

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

| Attribute | Value |
| --- | --- |
| Request method | POST |
| Endpoint | `/api/issues/issueID` |
| Request body | ``` {     "customFields":[         {             "name": "State",             "$type": "StateProjectCustomField",             "value":             {                 "name": "Open"             }         }     ] } ``` |
| HTTP response code | 500 |

## Troubleshooting﻿

Here are some possible causes and suggestions on how to overcome this error and update the custom field in the issue.

### Cause﻿

Your request tried to update a custom field in an issue, but the request body referred to a custom field in a project.

### Solution﻿

Pass the corresponding issue custom field type in the request body.

The error message indicates that in this particular request, YouTrack expects an entity of the `IssueCustomField` type instead of `StateProjectCustomField`. Since `IssueCustomField` is an abstract ancestor for all custom fields in issues, you need to use a type of one of its descendants in the request body. In our case, it's `StateIssueCustomField`.

Here's the updated request body:

{
  "customFields":[
    {
      "name": "State",
      "$type": "StateIssueCustomField",
      "value":
        {
          "name": "Open"
        }
     }
  ]
}

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

- [500 Server Error When Updating a Custom Field](/help/youtrack/devportal/api-troubleshoot-incorrect-field-type.html)
- [Error Message](/help/youtrack/devportal/api-troubleshoot-incorrect-field-type.html#error-message)
- [Request Details](/help/youtrack/devportal/api-troubleshoot-incorrect-field-type.html#request-details)
- [Troubleshooting](/help/youtrack/devportal/api-troubleshoot-incorrect-field-type.html#troubleshooting)

[400 Bad Request When Updating a Conditional Field](jetbrains__com__help__youtrack__devportal__api-troubleshoot-updating-conditional-field.md)[500 Server Error When Adding a Field to a Project](jetbrains__com__help__youtrack__devportal__api-troubleshoot-custom-field-prototype.md)

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

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