Changing resources
A PATCH body is a JSON merge patch (RFC 7396), sent as application/json. Send only what should change — never the whole resource. Every field carries one of three meanings:
omitted
leave it as it is
null
clear it
a value
set it to that value
{"assigneeId": 17, "priorityName": null}That assigns the ticket and clears its priority. Everything else keeps its current value, so there is no read-modify-write cycle and no risk of writing back a field you never meant to touch.
Rules worth knowing:
A relation is changed through the scalar that identifies it —
assigneeId,statusName,typeName— never by embedding the related object. A nestedassigneeobject in the body is ignored.An array replaces the whole collection. Merge patch does not merge arrays:
{"labels":["billing"]}leaves exactly one label, and both{"labels":null}and{"labels":[]}remove all of them. A label name that does not exist yet is created.A field that cannot be empty has no
nullform.statusNameandsubjectare always set, so an explicitnullthere leaves the current value unchanged instead of clearing it.A status change is validated against the configured transitions and answered with
400when the transition is not permitted.The response carries the patched resource under
data.
Last updated
Was this helpful?