Ticket Types
How to create and update ticket types using Leera AI prompting.
Ticket Types (AI Prompting)
Concise guide to instruct Leera AI to create or modify ticket type definitions safely.
Core Concepts
- Ticket Type: Named schema describing a class of tickets.
- Field: Data element (system or custom).
- System Fields: id, status, createdAt, updatedAt (immutable).
- Custom Fields: User-defined, versioned.
- Lifecycle: Optional stage flow (e.g. Draft → Active → Deprecated).
Supported Field Kinds
text, textarea, enum, number (int|float), boolean, date, datetime, user, relation (one-to-many / many-to-one), tags.
Create Prompt: Required Parts
- Intent: "Create ticket type"
- Name (+ plural if needed)
- Description (purpose + value)
- Fields (name, type, required?, description, constraints, default)
- Validation rules (patterns, min/max, maxLength)
- Lifecycle (optional)
- Visibility / permissions (optional)
- Output format (JSON contract)
Update Prompt: Required Parts
- Intent: "Update ticket type"
- Target identifier (exact name or id)
- Change set:
- ADD field
- MODIFY field (describe old vs new)
- DEPRECATE field (with migration)
- Data migration / backfill rules
- Version bump rationale
- Explicit "No other changes"
- Output format (JSON diff)
JSON Output Shape (Example)
Good Create Prompt (Example)
Poor Create Prompt (Anti-Pattern)
Issues: vague intent, no schema, no constraints, no output format.
Good Update Prompt (Example)
Validation Prompt (Self-Check)
Prompt Style Guidelines
- Single clear intent (create or update).
- Explicit field list; one line per field.
- Use snake_case for field identifiers.
- Mark required vs optional.
- Provide numeric constraints (maxLength, min, max).
- For enum: list options (label + value) and optional default.
- For deprecation: give migration strategy (mapping, copy, derived default).
- Demand structured JSON: "Return ONLY JSON".
Common Mistakes & Fixes
- Missing action keyword -> Add "Create" or "Update".
- Update without target -> Provide exact name/id.
- Enum without options -> List options array.
- Silent removal -> Use deprecations with reason + migration.
- Ambiguous type (e.g. "long text") -> Specify textarea.
Reusable Snippets
Field template:
Deprecation template:
Migration mapping example:
Safety Practices
- Require confirmation step for destructive changes.
- Reject prompt if change set omits migration for deprecation.
- Auto-validate JSON against schema before applying.
- Log version history.
Tip: Short, explicit, enumerated prompts reduce hallucination. Warning: Do not allow implicit field deletions; always deprecate with migration.
Checklist (Copy/Paste)
Next
Proceed to workflow automation prompting after stabilizing ticket type