REST API error handling

Need help with REST API error handling.

Request:

POST https://youtrack.foo.bar/api/issues/2-376211

{
    "customFields": [
        {
            "value": {
                "login": "hoia",
                "$type": "User"
            },
            "name": "Developer",
            "$type": "SingleUserIssueCustomField"
        },
        {
            "value": {
                "login": "eae",
                "$type": "User"
            },
            "name": "Client",
            "$type": "SingleUserIssueCustomField"
        }
    ]
}

Response:

{
    "error": "",
    "error_description": "Value is not allowed",
    "error_developer_message": "Value is not allowed",
    "error_field": "value"
}

How can I determine which custom field is invalid in this case? Is there any way to make errors more informative?

0
1 comment
Official comment

Hi!

I'm Sergey from the YouTrack team.

I've replied to you in your direct support ticket. Copying the answer here as well.

As the error is returned for the value object, it's not possible to provide an error which value it is exactly for at the moment, I'm afraid. I've passed your feedback to the relevant team, though, so hopefully it'll be addressed in the future.

For now, though, firstly, make sure that the passed users are added to the values of these fields in the issue's project:

Please sign in to leave a comment.