Incorrect Custom Field Type
This article examines an error that might happen when you try to 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
Request Details
Here you can find the details about an example 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 you can find possible causes and suggestions on how to get rid of the error.
Cause | Your request tried to update a custom field in an issue, but the request body was referring 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 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. |