Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.93 KB

File metadata and controls

25 lines (20 loc) · 1.93 KB

Ticket Analysis Strategy

Goal

Automatically assign the appropriate task custom object to tickets previously marked as common‑tasks by updating the dedicated custom field.

Approach

  1. Retrieve tickets – Use Invoke-ZendeskApiCall.ps1 with a search query that returns tickets of type task and the custom field indicating they are common‑tasks.
  2. Load task definitions – Parse custom-objects.json to obtain the list of task objects (id, name, optional keywords).
  3. Extract candidate phrases – For each ticket, combine subject and description, tokenize, remove stop‑words, and generate n‑grams.
  4. Match to task objects – Compare ticket phrase set with each task’s keyword set (or with the task name/description) using a simple similarity metric (e.g., Jaccard). Choose the highest‑scoring task above a configurable threshold.
  5. Update ticket – Call Invoke-ZendeskApiCall.ps1 with PUT /api/v2/tickets/{id}.json to set the custom field that references the matched task object.
  6. Logging – Write a CSV (TaskAssignmentLog.csv) containing TicketId, MatchedTaskId, Score, and Timestamp for audit and later review.

Adaptability

  • The script queries the ticket schema at runtime, so changes to field names or custom‑field IDs do not require code changes.
  • Adding a new task only requires updating custom-objects.json with its keywords; the next run will automatically consider it.
  • The similarity threshold can be tuned based on manual review of the generated log.

Next Steps (reflected in task.md)

  • Implement Get-CommonTaskTickets.ps1 (fetch tickets).
  • Implement Get-TaskPhrases.ps1 (phrase extraction).
  • Implement Update-TaskCustomField.ps1 (matching + custom‑field update).
  • Run the end‑to‑end flow on a test set and review TaskAssignmentLog.csv.

All scripts follow the existing PowerShell style (parameter validation, Test-ZendeskEnvironment, verbose progress).