c.l.cladDocs

Issues

Create issues from your systems, read the inbox, and manage status, priority, tags, and assignment.

Issues (tickets) are the core object. Create them from your own systems, read the inbox, and manage status, priority, tags, assignment, and spam/trash state.

Create an issue

mutation Create($input: CreateIssueInput!) {
  createIssue(input: $input) {
    issue { id ticketNumber subject status }
    error { code message fields { path message } }
  }
}

CreateIssueInput fields:

FieldRequiredDescription
subjectYesIssue title.
bodyYesFirst inbound message (plain text).
priorityNolow | normal | high | urgent.
requesterEmailNoRequester email; used to create/link a contact.
requesterNameNoRequester display name.
contactIdNoLink to an existing CRM contact (opaque id).
accountIdNoLink to an existing CRM account (opaque id).
tagsNoTags to apply.
externalIdNoYour stable id; reusing it returns the original issue.
idempotencyKeyNoDedupe key for safe retries.

List the inbox

query Inbox($after: String) {
  issues(first: 25, after: $after, target: all, status: new, sortKey: createdAt) {
    edges { node { id ticketNumber subject status priority lastMessageAt } }
    pageInfo { hasNextPage endCursor }
  }
}

issues supports filters: target (all | my | following | spam | trash), status, tag, accountId, assigneeProfileId, search, and sortKey (createdAt | updatedAt).

Manage an issue

mutation Triage($id: ID!) {
  setIssueStatus(issueId: $id, status: on_hold) { issue { id status } error { code message } }
  setIssuePriority(issueId: $id, priority: urgent) { issue { id priority } error { code message } }
  setIssueTags(issueId: $id, tags: ["billing", "escalated"]) { issue { id tags } error { code message } }
  assignIssue(issueId: $id, assigneeProfileId: "<profile-id>") { issue { id assignedTo } error { code message } }
}

Other issue mutations: setIssueAccount, setIssueTeams, setIssueSpam, setIssueTrashed, followIssue, unfollowIssue.