Skip to content

feat: agents and API decide about the question when closing (v0.2.0) - #2

Merged
studio-prisma merged 2 commits into
mainfrom
feat/0.2.0
Nov 8, 2026
Merged

studio-prisma merged 2 commits into
mainfrom
feat/0.2.0

Conversation

@studio-prisma

Copy link
Copy Markdown
Owner

What changes

  • Agent panel: the reply form, the note form and the status dialog get a tick "Send satisfaction question". It shows only for a status that would ask, on a ticket the rules would ask, and is on by default. Removing it means never for this ticket: row state declined plus an internal note.
  • More menu: "No satisfaction question" / "Allow satisfaction question again" before closing. It sends a POST to scp/ajax.php/feedback/ticket/<id>/decline|allow with osTicket's CSRF token, and the agent needs access to the ticket.
  • Setting "Closing without an agent form": covers API, cron and mass status changes in the ticket list. Values: ask (default, behaviour as in 0.1), only when the request asks for it (feedback_ask=1), never. feedback_ask=0 declines.
  • Setting "Agents can switch the question off": default on.
  • Sent-question note names what triggered it.
  • Version 0.2.0: README, INSTALL (with two new security-gate rows), SECURITY and CHANGELOG updated.

The UI gets into the ticket view through an output buffer, the same way Board adds its tab. It also works with PJAX and checks the ticket ID, so a stale script never acts on another ticket.

Related: studio-prisma/osticket-api-endpoints#18 (feedback field → feedback_ask). Spec: Feedback 0.2.0 (decisions F1–F4: decline is permanent, menu switch, mass like API, API live "only when requested").

Type

  • New feature
  • Documentation

Security impact

  • Changes who gets asked (FeedbackRules, FeedbackTrigger)
  • New staff endpoint (FeedbackUi::toggle)

What changes for an outsider:

  • Toggle endpoint: needs an agent session, osTicket's CSRF token and checkStaffPerm on the ticket. A test proves that a POST without the token is refused and changes nothing.
  • feedback_ask: it can only confirm or suppress a question the rules allow. A declined row also blocks later questions, like "already asked". Nobody can be asked who wasn't askable before.

Verification

  • php tests/unit.php: 155/155 (PHP 8.4)
  • npx playwright test: 67/67. New spec 9-decide.spec.js covers:
    • web decline and ask
    • API with "requested": none / 1 / 0
    • mass change
    • ineligible ticket
    • UI tick in the reply form and the status dialog
    • menu off/on through the real POST
    • CSRF refusal
    • no UI for Alerts tickets
  • No hardcoded hostnames, credentials or absolute paths added

A tick "Send satisfaction question" in the reply form, the note form and
the status dialog of the agent panel; removing it means never for this
ticket (row state declined, internal note). "No satisfaction question" /
"Allow … again" in the ticket's More menu, a POST with osTicket's CSRF
token and the agent's ticket permission.

Closes without an agent form (API, cron, mass status change in the
ticket list) follow a new setting: ask (default, as before), only when
the request asks for it, or never. Requests pass feedback_ask=1|0; the
flag confirms or suppresses, it never widens the rules. The note after a
sent question names what triggered it.
@studio-prisma
studio-prisma merged commit 9854ff4 into main Nov 8, 2026
9 checks passed
@studio-prisma
studio-prisma deleted the feat/0.2.0 branch November 8, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant