Repository navigation
Conversation
1 task done
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 18, 2026 16:08
677a706 to
e70d32c
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
2 times, most recently
from
November 18, 2026 16:32
3768841 to
f591563
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 18, 2026 16:32
e70d32c to
2d9286c
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
from
November 18, 2026 17:37
f591563 to
aba025f
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 18, 2026 17:47
aaf430c to
8a246c7
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
from
November 18, 2026 17:47
aba025f to
3d53583
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
2 times, most recently
from
November 18, 2026 18:04
4dd5f71 to
76bc693
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
2 times, most recently
from
November 18, 2026 18:17
152d4b8 to
1176599
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 18, 2026 18:17
76bc693 to
602d9e6
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
3 times, most recently
from
November 19, 2026 10:27
3a29221 to
c2d6fe5
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 19, 2026 10:27
f7acc34 to
47c7c69
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
2 times, most recently
from
November 19, 2026 13:15
2ccde0c to
d54980b
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 19, 2026 13:15
6c93cd1 to
486b36f
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
2 times, most recently
from
November 19, 2026 15:04
0a78892 to
7e8d077
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 19, 2026 15:04
12cf2b2 to
45f1db3
Compare
1 task done
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 19, 2026 16:07
45f1db3 to
b058a99
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
2 times, most recently
from
November 19, 2026 16:23
6895625 to
f980027
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
2 times, most recently
from
November 19, 2026 17:24
6a5e26f to
ab971ef
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
from
November 19, 2026 17:24
f980027 to
acbad62
Compare
1 task done
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 19, 2026 17:28
ab971ef to
d483afc
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
2 times, most recently
from
November 19, 2026 17:35
7ad0966 to
b765a7c
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 19, 2026 17:35
d483afc to
5c27337
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
2 times, most recently
from
November 19, 2026 18:11
64a2482 to
3f2cd30
Compare
1 task done
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
from
November 19, 2026 18:23
3f2cd30 to
8729cfb
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 19, 2026 18:23
08deba1 to
6fca5cb
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
2 times, most recently
from
November 19, 2026 18:26
f25545b to
7705b91
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 19, 2026 18:26
41fc5bd to
487ed73
Compare
funana777
added a commit
that referenced
this pull request
Nov 19, 2026
A check against support.nextcloud.com showed that Zammad stores a note posted as form fields with internal=1 as internal, the way Nextcloud's HTTP client sends an array body. The JSON option on ZammadAPIService::request() is no longer needed, so #297 leaves that service unchanged. Assisted-by: ClaudeCode:claude-opus-5-5
funana777
added a commit
that referenced
this pull request
Nov 19, 2026
A check against support.nextcloud.com showed that Zammad stores a note posted as form fields with internal=1 as internal, the way Nextcloud's HTTP client sends an array body. The JSON option on ZammadAPIService::request() is no longer needed, so #297 leaves that service unchanged. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Christian Fu Mueller <christian-fu.mueller@nextcloud.com>
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
from
November 19, 2026 18:38
3219f1d to
14b3ba9
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 19, 2026 18:52
487ed73 to
bcd138a
Compare
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
2 times, most recently
from
November 19, 2026 18:58
efa72f0 to
b08ebcb
Compare
funana777
force-pushed
the
feat/zammad-assistant-read
branch
from
November 19, 2026 18:58
bcd138a to
80f4fbf
Compare
marcelklehr
reviewed
Nov 24, 2026
| $this->l10n->t('Ticket %s does not exist, or your Zammad account has no access to it.', [(string)$ticketId])), | ||
| default => self::error(Http::STATUS_BAD_GATEWAY, 'zammad_error', $this->l10n->t('Zammad answered with an error.')), | ||
| }; | ||
| return $this->zammadError($response, $ticketId); |
Member
There was a problem hiding this comment.
Unrelated change? Shouldn't be in this PR, IMO.
marcelklehr
reviewed
Nov 24, 2026
| $this->l10n->t('Give a ticket ID or a ticket link like %s/#ticket/zoom/123.', [$zammadUrl])); | ||
| $ticketId = TicketText::parseTicketReference($zammadUrl, $ticket)['id'] ?? null; | ||
| if ($ticketId === null) { | ||
| return $this->invalidTicket($zammadUrl, $ticket); |
marcelklehr
reviewed
Nov 24, 2026
| } | ||
| } | ||
|
|
||
| $footer = self::ASSISTANT_FOOTER_PREFIX . $this->getAuthorName(); |
Member
There was a problem hiding this comment.
Let's not lose generality of the API. Anyone could be using this API and would then get the created by assistant footer. That's not nice.
marcelklehr
reviewed
Nov 24, 2026
| 'sender' => self::stringOrNull($article['sender'] ?? null), | ||
| 'type' => self::stringOrNull($article['type'] ?? null), | ||
| 'internal' => !empty($article['internal']), | ||
| 'assistant_note' => self::isAssistantNote($article), |
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
2 times, most recently
from
November 24, 2026 13:42
8016961 to
9daa1e1
Compare
Author
|
Thanks! All four addressed:
|
POST /api/v1/ticket/notes writes an internal note with the user's own token, so Zammad shows the user as its author and decides whether they may add notes. The note is plain text and is stored as given: the API adds no footer and does not check for earlier notes, so any client can use it. Marking and recognizing the Assistant's own notes is up to the client. A note is refused if the ticket has a different number than the one the caller meant, a mistake an agent can make with similar tickets. The title a client shows the user is not checked. The capability's ticket_api goes to 2, so clients only offer notes where the route exists. On support.nextcloud.com, a note posted as form fields with internal=1, the way Nextcloud's HTTP client sends it, was stored as an internal note and rendered with its line breaks. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Christian Fu Mueller <christian-fu.mueller@nextcloud.com>
funana777
force-pushed
the
feat/zammad-assistant-notes
branch
from
November 24, 2026 16:41
9daa1e1 to
05b9ac8
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets the Nextcloud Assistant, and any other client, add internal notes to Zammad tickets.
Base: #296 (
feat/zammad-assistant-read). Merge #295 and #296 first. The Assistant's tool is nextcloud/context_agent#335.Why
Support agents work in Zammad, so an analysis of a ticket is most useful as an internal note there, where colleagues see it.
What
POST /api/v1/ticket/noteswithticket(ID or link),textandticket_numberadds an internal note, written with the user's own token. Zammad shows the user as author and decides whether they may add notes. No replies to customers.ticket_numberdoes not belong to the ticket, the note is refused (400ticket_mismatch). The response names the ticket's number and title. The title the client shows the user is not checked.ticket_apigoes to 2, so clients only offer notes where the route exists.408 lines added, 3 removed; without
openapi.json134 added, of which 44 are tests.How to test
composer run test:unitcurl -u user:pass -H 'OCS-APIRequest: true' -H 'Content-Type: application/json' -X POST 'https://<nextcloud>/ocs/v2.php/apps/integration_zammad/api/v1/ticket/notes?format=json' -d '{"ticket":"<id>","ticket_number":"<number>","text":"Summary\n- first point"}'ticket_mismatch.🤖 AI (if applicable)
Code, tests and this description were drafted with Claude Code (claude-opus-5-5) under my direction.
How this was tested before opening the PR
This version: 24 unit tests on Nextcloud 35 (note stored as given, wrong ticket number, Zammad errors, empty and too long notes, not connected), psalm, php-cs-fixer, OpenAPI extractor v1.9.1.
An earlier version, which added the footer on the server, ran on a sandbox Nextcloud 35.0.1 with a fake Zammad, directly and through the Context Agent. Against support.nextcloud.com, on a test ticket: a
text/plaininternal note posted form-encoded withinternal=1, as Nextcloud's HTTP client sends it, was stored as internal, typenote, senderAgent, and rendered with its line breaks and-list lines, so no JSON option is needed.This version (
05b9ac8, rebased on #296 with the contact-times fix) ran end to end on 2026-11-24 on a sandbox Nextcloud 35.0.1 against a fake Zammad, together with #298 and nextcloud/context_agent#335: through the Context Agent with scripted tool calls (confirmation asked, note stored internal and form-encoded with the footer the tool adds,ticket_mismatchwith nothing sent to Zammad, the add-note tool hidden withticket_api1) and with Claude Haiku as the model. The run found that the tool's check for an earlier note needs the single ticket'slast_contact_customer_at, which #296 now returns. The route has not run against a real Zammad yet.Generated by Claude Code