PATCH field. comments is not on the PATCH whitelist, so a
comment sent through PATCH returns 200 and stores nothing — these are the
endpoints that actually write.
Add a comment
201, with the stored comment:
author comes from the token, time
from the server clock, and the timeline entry that makes the comment visible in
the app is written for you.
body must be a non-blank string. null, a number, "" and whitespace-only
text are each 422 — a blank comment renders as an empty timeline entry, which
is indistinguishable from nothing having been stored.
Attach a photo
multipart/form-data, one part named photo:
201:
The photo is attached as a comment
The upload writes a comment whoseattachments holds the stored file name, and
that is how the photo reaches the apps: it shows in the ticket’s timeline, and
on the drawing pin’s popover. The note is empty, which is what the apps write
for an attachment-only comment too.
A .256x192 thumbnail is generated and stored alongside the original —
thumbnailFileName names it. The apps request that name directly, so you get
both files or neither: a photo whose thumbnail cannot be produced is refused
rather than stored half-way.
What is accepted
image/jpeg and image/png, judged by decoding the bytes. The part’s
declared Content-Type and the file name are both ignored, so a PNG renamed
.jpg is accepted and stored as a PNG, and a PDF renamed .jpg is refused:
detail — the 'photo' part is image/gif; … — so you can tell “wrong format” from “not an image at all”.
The detail lists a third type, image/jpg. Nothing is ever detected as one —
a JPEG is detected as image/jpeg — so the response contentType is only ever
image/jpeg or image/png. The message quotes the server’s allowed-types list,
which it shares with the project endpoint, rather than the set of outcomes.
Read the files back
Both the original and the thumbnail are readable fromsecuredata, using the
stored names:
End to end
Raise a ticket, attach the evidence, then say what you found:Concurrency
Both endpoints take an optionalIf-Match carrying the ticket’s current
_rev:
_rev fails with 409 and writes nothing. Omit the header and the
latest revision is read.
Both writes are additive — a comment is appended, a photo is added beside
whatever is already attached — so unlike PATCH there is nothing here that can
overwrite someone else’s change. If-Match is worth using when you want to be
sure the ticket you read is the ticket you are commenting on, and can safely be
left off otherwise.
Errors
RFC 9457application/problem+json, whose detail names the problem:
Authorization is evaluated before the request body, so a
403 says nothing
about whether your JSON or your image was valid.
Who may do what
Commenting is deliberately the wider of the two. A comment cannot overwrite
anything, and someone who raised a ticket needs to be able to answer a question
about it once work has started. An attachment is a permanent binary on the
document that this API cannot remove, so it inherits the narrower rule that
PATCH puts around editing content.
See Roles & permissions.
What you still cannot do
- Give a ticket a map snapshot. The crosshair image at
content.attachments[0]is a different thing in a different place — see Ticket snapshots. This endpoint attaches photos only. - Attach anything but a JPEG or a PNG. No PDFs, no video, no documents.
- Delete a comment or an attachment. Both are in-app actions.
- Attach at creation time. Create the ticket first, then upload — two calls.
