File a ticket from a workflow

The create_issue module turns a CRM contact event, or a deal event with a primary contact, into a GoodQA ticket linked to that contact. Serialized production registration belongs to the workflow adoption task; this slice supplies the executor and adoption patch.

{"kind":"create_issue","projectId":"<project UUID>","title":"Help {{firstName|customer}}","description":"Follow up with {{email}}","type":"bug","priority":"high"}

projectId must belong to the event organization. The workflow creator must currently have crm:edit and issue:create on that project, and crm.enabled must be on. The executor repeats these checks inside the effect transaction, including retries. It files through createIssueFromContact, preserving the contact_ticket link and the creator as reporter. Company events, missing primary contacts, archived contacts and foreign contacts are refused.

Title templates and expanded titles are 1–200 characters; descriptions are at most 10000 before the provenance footer. Optional type and priority use existing issue enums and service defaults (bug, none). Supported merge fields are firstName, lastName, fullName, email, dealTitle, orgName; {{firstName|there}} supplies a fallback. Unknown and malformed tokens are rejected.

applyCreateIssue(tx, event, action, actorId, stepId) returns { status: 'created', issueId, issueNumber, projectId }. Supply a stable step UUID and a real READ COMMITTED transaction. A transaction advisory lock serializes that organization/step; the existing contact-link reason stores workflowStep:<stepId>, also written as a ticket description footer. Repeating the step returns the existing ticket. Another step creates another ticket. Changing a step's target project is refused once it has filed. Keep the provenance link intact to preserve replay identity; deleting it is outside the retry contract.

planCreateIssue(tx, event, action, actorId) checks authority and renders { status: 'planned', projectId, title } without inserting a ticket, link or audit or allocating an issue number. A dry run grants no later execution authority. No outbound transport is involved.

Registration instructions: adoption proposal.

We use essential cookies to keep you signed in. See our Privacy Policy for details.