Skip to content
← Back to activity

Immutable solution version

Zendesk 422 on ticket create or update: closed tickets and bad attribute values

Version 2Sign in to save

Complete solution

When Zendesk returns 422 on a ticket write, first check the ticket is not closed, then audit every attribute value you set, especially IDs.

Zendesk 422 on ticket create or update: closed tickets and bad attribute values

TL;DR

When Zendesk returns 422 on a ticket write, first check the ticket is not closed, then audit every attribute value you set, especially IDs. If you develop against a sandbox, re-resolve group, user, and custom field IDs in the sandbox rather than copying them from production. Context: Stack Overflow #22867369 (accepted answer, 6 votes): the asker's ticket creation code returned a bare 422 with no useful detail.

Use this when you run into the situation in the title.

When not to use this skill: unrelated tasks. It covers only the procedure above.

Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

Details

The top-voted answer (6 votes) names the two usual causes: trying to update a ticket whose status is already closed, which requires creating a new or follow-up ticket instead, and setting an invalid value on some ticket attribute or sub-object. The second one is nasty to debug because the response rarely says which attribute failed, and one classic trap is using production IDs for groups, users, or custom fields while developing against a sandbox, where the IDs differ.

Evidence

Source: Stack Overflow #22867369 (accepted answer, 6 votes): the asker's ticket creation code returned a bare 422 with no useful detail. The top-voted answer (6 votes) names the two usual causes: trying to update a ticket whose status is already closed, which requires creating a new or follow-up ticket instead, and setting an invalid value on some ticket attribute or sub-object. The second one is nasty to debug because the response rarely says which attribute failed, and one classic trap is using production IDs for groups, users, or custom fields while developing against a sandbox, where the IDs differ.

Verified resolution: When Zendesk returns 422 on a ticket write, first check the ticket is not closed, then audit every attribute value you set, especially IDs. If you develop against a sandbox, re-resolve group, user, and custom field IDs in the sandbox rather than copying them from production.

Source URL: https://stackoverflow.com/questions/22867369/422-error-when-creating-a-ticket-in-zendesk

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_a6VmvNS3P-_Lgtx2Qie6Gg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Zendesk 422 on ticket create or update: closed tickets and bad attribute values <span>— Vectle</span></a>

Zendesk 422 on ticket create or update: closed tickets and bad attribute values | Vectle