The  Basics
###########

**Basics of Working with a Ticket in Znuny**

In Znuny, a **ticket** is the central record for tracking a request, incident, or task.
It contains all communication and metadata related to that issue and may be linked to other tickets or objects in the system.

**Core things you can do with a ticket:**

* **View details** - See the ticket's title, state, priority, queue, owner, and full article history.
* **Communicate** - Add articles via email, phone logs, or internal notes.
* **Change state** - Mark tickets as *new*, *open*, *pending*, or *closed*.
* **Assign** - Set the **Owner** (agent actively working on it) and/or **Responsible** (person accountable).
* **Categorize** - Apply ticket type, service, and SLA if used in your organization.
* **Move** - Change the queue to route the ticket to the right team.
* **Lock/Unlock** - Lock to yourself while working to prevent others from editing it at the same time.
* **Search & Filter** - Use overviews or search tools to find tickets you own, are responsible for, or that match specific conditions.

**Ticket Lifecycle in Znuny**

The **ticket lifecycle** describes the states a ticket typically goes through from creation to closure.

A common flow looks like this:

1. **Creation**

   * Tickets can be created by:

     * Customer emails (inbound)
     * Phone calls (agent logs a phone ticket)
     * Customer portal (web form)
   * The ticket enters the system, usually with **State: new** in an initial queue, **open** if created by an agent.

2. **Classify and Categorize**

* Agent or automated rules determine such things as:
  
  * Which queue it belongs to
  * Who should own or be responsible for it
  * Priority level
  * Ticket type and service (if applicable)
  * Record Additional metadata like workstation data or other relevant information.
* May involve moving the ticket to the correct support group.

3. **Work in Progress**

   * State changes to **open**.
   * Agents communicate with the customer, troubleshoot, and document updates via ticket articles.
   * The ticket remains in an open state until the issue is resolved or more info is needed.

.. important:: 
    
    "open" state means the ticket is actively being worked on. These include states like "open", "pending reminder", or "pending auto close+/-".


4. **Pending States** *(optional)*

   * If waiting for customer input or an external event, set to:

     * **Pending Reminder** - Changes back to *open* automatically when the reminder date arrives.
     * **Pending Auto Close** - Automatically closes after the set date/time.

5. **Resolution & Closure**

   * When solved, ticket state changes to **closed successful** (or another closing state).
   * If the request cannot be fulfilled, it might be **closed unsuccessful**.
   * Closure may be manual or automated based on workflow.

6. **After Closure**

   * The ticket can be found and reopened at any time by an agent.

**Key Tips for Agents**

* Always **lock** a ticket before working on it to avoid conflicts.
* Keep **article history clear and complete** — everything you do should be documented.
* When closing, make sure the **resolution is documented** in the final article. A summary helps future reference and should be mailed or made available to the customer via a visible article.    


.. mermaid:: 
   :caption: Ticket Lifecycle in Znuny
   :zoom: true

   %%{init: {"theme": "base", "themeVariables": {
      'primaryColor': '#fefefe',
      'lineColor': '#aaa'
   }}}%%

   stateDiagram-v2
       [*] --> New: Ticket created (email/web/phone)
       New --> Open: Classified / Assigned / Worked on
       Open --> PendingReminder: Set pending reminder
       Open --> PendingClose: Set pending close
       Open --> ClosedSuccessful: Resolved & closed
       Open --> ClosedUnsuccessful: Cannot fulfill / canceled

       PendingReminder --> Open: Reminder reached / customer replied
       PendingReminder --> ClosedSuccessful: Agent closes

       PendingClose --> ClosedSuccessful: Pending time reached
       PendingClose --> Open: Customer replies before close

       ClosedSuccessful --> Reopened: Follow-up received (if allowed)
       ClosedUnsuccessful --> Reopened: Follow-up received (if allowed)
       Reopened --> Open

       note right of Open
         Work in progress:
         - Communicate (email/phone/note)
         - Change owner/responsible
         - Move queues / set priority
         - Lock or unlock ticket
       end note
