AgentSkillsCN

Tickets

当您需要管理Autotask工单时,可使用此技能:创建、更新、搜索或管理服务台相关业务。本技能覆盖工单字段、队列、状态、优先级、SLA协议、升级规则以及工作流自动化,内置了验证逻辑、SLA计算与指标统计功能,是MSP技术人员通过Autotask PSA高效处理服务交付的必备工具。

SKILL.md
--- frontmatter
description: >
  Use this skill when working with Autotask tickets - creating, updating,
  searching, or managing service desk operations. Covers ticket fields,
  queues, statuses, priorities, SLAs, escalation rules, and workflow automations.
  Includes business logic for validation, SLA calculations, and metrics.
  Essential for MSP technicians handling service delivery through Autotask PSA.
triggers:
  - autotask ticket
  - service ticket
  - create ticket autotask
  - ticket queue
  - ticket status
  - ticket priority
  - autotask service desk
  - ticket triage
  - escalate ticket
  - resolve ticket
  - ticket notes
  - time entry ticket
  - sla calculation
  - ticket metrics
  - ticket kpi

Autotask Ticket Management

Overview

Autotask tickets are the core unit of service delivery in the PSA. Every client request, incident, problem, and change flows through the ticketing system. This skill covers comprehensive ticket management including business logic, SLA calculations, escalation rules, and performance metrics.

Ticket Status Codes

Based on the Autotask API, these are the standard ticket status values:

Status IDNameDescriptionBusiness Logic
1NEWNewly created ticketDefault for new tickets, SLA clock starts
2IN_PROGRESSActively being workedResource should be assigned
5COMPLETEIssue resolvedRequires resolution field, stops SLA
6WAITING_CUSTOMERAwaiting customer responseSLA clock may pause
13WAITING_MATERIALSWaiting for parts/equipmentSLA clock may pause
14ESCALATEDEscalated to higher tierRequires escalation reason

Status Transition Rules

code
NEW (1) ──────────────────────────────> COMPLETE (5)
   │                                        ↑
   ↓                                        │
IN_PROGRESS (2) ──────────────────────────>─┤
   │         │                              │
   │         ↓                              │
   │    WAITING_CUSTOMER (6) ──────────────>─┤
   │         │                              │
   │         ↓                              │
   │    WAITING_MATERIALS (13) ────────────>─┘
   │
   ↓
ESCALATED (14) ─────> IN_PROGRESS (2) ────> COMPLETE (5)

Validation Rules:

  • Completing directly from NEW generates a warning
  • COMPLETE requires resolution field
  • ESCALATED requires escalation reason
  • IN_PROGRESS should have assigned resource

Ticket Priority Levels

Priority IDNameResponse SLAResolution SLABusiness Context
4CRITICAL1 hour4 hoursComplete business outage
3HIGH2 hours8 hoursMajor productivity impact
2MEDIUM4 hours24 hoursSingle user/workaround exists
1LOW8 hours72 hoursMinor issue/enhancement

Note: In Autotask, lower numbers = lower priority. Priority 4 is most urgent.

Complete Ticket Field Reference

Core Fields

FieldTypeRequiredDescription
idintSystemAuto-generated unique identifier
ticketNumberstringSystemHuman-readable (e.g., T20240215.0001)
titlestring(255)YesBrief issue summary
descriptiontextNoDetailed description
companyIDintYesCompany/account reference
companyLocationIDintNoSite/location within company
contactIDintNoPrimary contact for ticket

Classification Fields

FieldTypeRequiredDescription
statusintYesCurrent status (see codes above)
priorityintYesUrgency level (1-4)
queueIDintYesService queue for routing
issueTypeintNoPrimary category
subIssueTypeintNoSub-category
ticketTypeintNoService Request, Incident, Problem, Change
ticketCategoryintNoAdditional categorization

Assignment Fields

FieldTypeRequiredDescription
assignedResourceIDintNoTechnician assigned
assignedResourceRoleIDintNoRole for billing
creatorResourceIDintSystemWho created the ticket
lastActivityResourceIDintSystemLast person to update

SLA & Timeline Fields

FieldTypeRequiredDescription
createDatedatetimeSystemWhen ticket was created
dueDateTimedatetimeNoSLA due date/time
completedDatedatetimeSystemWhen marked complete
firstResponseDateTimedatetimeSystemFirst response timestamp
resolutionPlanDateTimedatetimeNoExpected resolution time
resolvedDateTimedatetimeSystemActual resolution time
lastActivityDatedatetimeSystemLast update timestamp

Contract & Billing Fields

FieldTypeRequiredDescription
contractIDintNoAssociated contract
contractServiceIDintNoSpecific service on contract
contractServiceBundleIDintNoService bundle
estimatedHoursdecimalNoEstimated effort
hoursToBeScheduleddecimalNoHours remaining

Resolution Fields

FieldTypeRequiredDescription
resolutiontextConditionalRequired when completing
resolutionTypeintNoResolution category

SLA Calculation Logic

Default SLA Times by Priority

typescript
const SLA_DEFAULTS = {
  CRITICAL: { response: 1, resolution: 4 },   // hours
  HIGH:     { response: 2, resolution: 8 },
  MEDIUM:   { response: 4, resolution: 24 },
  LOW:      { response: 8, resolution: 72 }
};

SLA Calculation Example

javascript
// Calculate SLA due dates
function calculateSLADueDate(ticket, contractSLA) {
  const now = new Date();
  const priority = ticket.priority || 2; // Default to MEDIUM

  // Use contract SLA if available, otherwise defaults
  const responseHours = contractSLA?.responseTimeHours || SLA_DEFAULTS[priority].response;
  const resolutionHours = contractSLA?.resolutionTimeHours || SLA_DEFAULTS[priority].resolution;

  return {
    responseBy: addHours(now, responseHours),
    resolveBy: addHours(now, resolutionHours),
    businessHoursOnly: true
  };
}

SLA Clock Behavior

StatusSLA Clock
NEWRunning
IN_PROGRESSRunning
WAITING_CUSTOMERPaused (configurable)
WAITING_MATERIALSPaused (configurable)
ESCALATEDRunning
COMPLETEStopped

Escalation Rules

Automatic Escalation Triggers

javascript
function checkEscalationRules(ticket) {
  const reasons = [];
  const now = new Date();

  // SLA Violation
  if (ticket.dueDateTime && new Date(ticket.dueDateTime) < now) {
    const hoursOverdue = Math.floor(
      (now - new Date(ticket.dueDateTime)) / (1000 * 60 * 60)
    );
    reasons.push(`SLA violated by ${hoursOverdue} hours`);
    escalationLevel = Math.min(3, Math.floor(hoursOverdue / 4) + 1);
  }

  // Stale Waiting Status
  if (ticket.status === 6 && ticket.lastActivityDate) {
    const daysSinceActivity = Math.floor(
      (now - new Date(ticket.lastActivityDate)) / (1000 * 60 * 60 * 24)
    );
    if (daysSinceActivity > 7) {
      reasons.push(`No customer response for ${daysSinceActivity} days`);
    }
  }

  // Critical Without Assignment
  if (ticket.priority === 4 && !ticket.assignedResourceID) {
    reasons.push('Critical ticket without assigned resource');
  }

  return { requiresEscalation: reasons.length > 0, reasons };
}

Escalation Levels

LevelTriggerAction
1SLA 0-4 hours overdueNotify assigned resource
2SLA 4-8 hours overdueNotify team lead
3SLA 8+ hours overdueNotify management

Ticket Metrics & KPIs

Key Performance Indicators

javascript
function calculateTicketMetrics(tickets) {
  const completedTickets = tickets.filter(t => t.status === 5);

  // Average Resolution Time (hours)
  const avgResolutionTime = completedTickets.reduce((sum, t) => {
    if (t.createDate && t.completedDate) {
      return sum + (new Date(t.completedDate) - new Date(t.createDate));
    }
    return sum;
  }, 0) / completedTickets.length / (1000 * 60 * 60);

  // SLA Compliance Rate
  const ticketsWithSLA = tickets.filter(t => t.dueDateTime);
  const slaCompliant = ticketsWithSLA.filter(t => {
    if (t.status === 5) {
      return new Date(t.completedDate) <= new Date(t.dueDateTime);
    }
    return new Date() <= new Date(t.dueDateTime);
  }).length;
  const slaCompliance = (slaCompliant / ticketsWithSLA.length) * 100;

  return {
    totalTickets: tickets.length,
    averageResolutionTime: avgResolutionTime.toFixed(2),
    slaCompliance: slaCompliance.toFixed(1) + '%',
    escalatedCount: tickets.filter(t => t.status === 14).length
  };
}

Status Distribution Report

json
{
  "statusDistribution": {
    "NEW": 12,
    "IN_PROGRESS": 45,
    "WAITING_CUSTOMER": 8,
    "WAITING_MATERIALS": 3,
    "ESCALATED": 2,
    "COMPLETE": 156
  },
  "priorityDistribution": {
    "CRITICAL": 1,
    "HIGH": 15,
    "MEDIUM": 38,
    "LOW": 22
  }
}

API Patterns

Creating a Ticket with Business Validation

http
POST /v1.0/Tickets
Content-Type: application/json
json
{
  "companyID": 12345,
  "title": "Unable to access email - multiple users affected",
  "description": "Sales team (5 users) reporting Outlook showing disconnected since 9am. Webmail working.",
  "queueID": 8,
  "priority": 3,
  "status": 1,
  "issueType": 5,
  "subIssueType": 12,
  "contactID": 67890,
  "dueDateTime": "2024-02-15T17:00:00Z"
}

Query Builder Patterns

Open tickets for company with includes:

json
{
  "filter": [
    {"field": "companyID", "op": "eq", "value": 12345},
    {"field": "status", "op": "noteq", "value": 5}
  ],
  "includeFields": ["Company.companyName", "AssignedResource.firstName", "AssignedResource.lastName"]
}

SLA-breached tickets:

json
{
  "filter": [
    {"field": "dueDateTime", "op": "lt", "value": "2024-02-15T12:00:00Z"},
    {"field": "status", "op": "in", "value": [1, 2, 6, 13, 14]}
  ]
}

Tickets by date range:

json
{
  "filter": [
    {"field": "createDate", "op": "between", "value": ["2024-02-01", "2024-02-29"]}
  ]
}

Updating Ticket Status

http
PATCH /v1.0/Tickets
Content-Type: application/json

Setting to Complete (requires resolution):

json
{
  "id": 54321,
  "status": 5,
  "resolution": "Cleared Outlook cache and repaired Office installation. Monitored for 30 minutes, email flow restored."
}

Setting to Escalated (requires reason):

json
{
  "id": 54321,
  "status": 14,
  "escalationReason": "Complex Exchange hybrid configuration issue requires senior engineer"
}

Adding Notes

http
POST /v1.0/TicketNotes
Content-Type: application/json

Internal Note:

json
{
  "ticketID": 54321,
  "title": "Initial Triage",
  "description": "Issue started after KB5034441 update. Known Outlook cache corruption issue.",
  "noteType": 1,
  "publish": 0
}

External Note (visible to client):

json
{
  "ticketID": 54321,
  "title": "Status Update",
  "description": "We've identified the cause of the issue. A technician is working on the fix and will have it resolved within the hour.",
  "noteType": 2,
  "publish": 1
}

Common Workflows

Ticket Creation Flow

  1. Validate company exists and has active contract
  2. Check for duplicates - search open tickets with similar title
  3. Auto-set defaults:
    • Status → NEW (1)
    • Priority → MEDIUM (2) if not specified
  4. Calculate SLA based on priority and contract
  5. Route to queue based on issue type
  6. Send acknowledgment to contact

Status Transition Validation

javascript
function validateStatusTransition(currentStatus, newStatus, ticket) {
  const requiredFields = [];
  const warnings = [];

  switch (newStatus) {
    case 5: // COMPLETE
      if (!ticket.resolution) requiredFields.push('resolution');
      if (currentStatus === 1) warnings.push('Completing without In Progress step');
      break;

    case 2: // IN_PROGRESS
      if (!ticket.assignedResourceID) warnings.push('No resource assigned');
      break;

    case 14: // ESCALATED
      if (!ticket.escalationReason) requiredFields.push('escalationReason');
      break;
  }

  return {
    canTransition: requiredFields.length === 0,
    requiredFields,
    warnings
  };
}

Error Handling

Common API Errors

CodeMessageResolution
400Invalid field valueVerify picklist IDs for your instance
400Status transition not allowedCheck workflow rules
401UnauthorizedVerify API credentials
403Insufficient permissionsCheck resource security level
404Entity not foundConfirm ticket/company exists
409Conflict/LockedTicket being edited by another user
429Rate limitedImplement exponential backoff

Validation Errors

ErrorCauseFix
CompanyID requiredMissing companyAll tickets need a company
QueueID invalidQueue not foundQuery /v1.0/Queues for valid IDs
Resolution requiredCompleting without resolutionAdd resolution text
Status transition invalidInvalid workflowCheck allowed transitions

Best Practices

  1. Validate before creating - Search for duplicates, verify company/contract
  2. Use descriptive titles - Include who's affected and symptoms
  3. Set accurate priority - Use impact/urgency matrix, not everything is Critical
  4. Log time immediately - Don't batch at end of day
  5. Update status promptly - Keeps queues accurate for reporting
  6. Document thoroughly - Future technicians will thank you
  7. Use internal notes for technical details - Keep external notes professional
  8. Monitor SLA metrics - Address breaches before they escalate

Related Skills