Skip to content

Latest commit

 

History

History
2146 lines (1763 loc) · 153 KB

File metadata and controls

2146 lines (1763 loc) · 153 KB

Ticketing

Overview

Available Operations

createTicket

Create a new ticket record.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";
import { TicketingTicketCreateRequestDtoValue } from "@stackone/stackone-client-ts/sdk/models/shared";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.createTicket({
    prefer: "heartbeat",
    ticketingTicketCreateRequestDto: {
      assignees: [
        "user-001",
        "user-002",
      ],
      componentIds: "[\"component-001\",\"component-002\"]",
      content: [
        {
          html: "<p>This is some content</p>",
          plain: "This is some content",
        },
        {
          html: "<p>This is some content</p>",
          plain: "This is some content",
        },
        {
          html: "<p>This is some content</p>",
          plain: "This is some content",
        },
      ],
      creatorId: "user-001",
      organizationId: "organization-001",
      parentId: "ticket-002",
      priority: {
        id: "001",
        sourceValue: "Normal",
        value: TicketingTicketCreateRequestDtoValue.Medium,
      },
      projectId: "project-001",
      reporters: [
        "user-001",
        "user-002",
      ],
      tags: [
        "tag-001",
        "tag-002",
      ],
      title: "System outage in production environment",
      type: "ticket-type-001",
      unifiedCustomFields: {
        "my_project_custom_field_1": "REF-1236",
        "my_project_custom_field_2": "some other value",
      },
    },
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingCreateTicket } from "@stackone/stackone-client-ts/funcs/ticketingCreateTicket.js";
import { TicketingTicketCreateRequestDtoValue } from "@stackone/stackone-client-ts/sdk/models/shared";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingCreateTicket(stackOne, {
    prefer: "heartbeat",
    ticketingTicketCreateRequestDto: {
      assignees: [
        "user-001",
        "user-002",
      ],
      componentIds: "[\"component-001\",\"component-002\"]",
      content: [
        {
          html: "<p>This is some content</p>",
          plain: "This is some content",
        },
        {
          html: "<p>This is some content</p>",
          plain: "This is some content",
        },
        {
          html: "<p>This is some content</p>",
          plain: "This is some content",
        },
      ],
      creatorId: "user-001",
      organizationId: "organization-001",
      parentId: "ticket-002",
      priority: {
        id: "001",
        sourceValue: "Normal",
        value: TicketingTicketCreateRequestDtoValue.Medium,
      },
      projectId: "project-001",
      reporters: [
        "user-001",
        "user-002",
      ],
      tags: [
        "tag-001",
        "tag-002",
      ],
      title: "System outage in production environment",
      type: "ticket-type-001",
      unifiedCustomFields: {
        "my_project_custom_field_1": "REF-1236",
        "my_project_custom_field_2": "some other value",
      },
    },
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("ticketingCreateTicket failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingCreateTicketRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingCreateTicketResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

downloadTicketingAttachment

Download the attachment file from a ticket.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.downloadTicketingAttachment({
    exportFormat: "text/plain",
    format: "base64",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingDownloadTicketingAttachment } from "@stackone/stackone-client-ts/funcs/ticketingDownloadTicketingAttachment.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingDownloadTicketingAttachment(stackOne, {
    exportFormat: "text/plain",
    format: "base64",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("ticketingDownloadTicketingAttachment failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingDownloadTicketingAttachmentRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingDownloadTicketingAttachmentResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getAttachment

Retrieve the details of a single attachment for a ticket.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.getAttachment({
    prefer: "heartbeat",
    fields: "id,remote_id,ticket_id,remote_ticket_id,user_id,remote_user_id,file_name,file_format,file_url,size,created_at,updated_at,unified_custom_fields",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingGetAttachment } from "@stackone/stackone-client-ts/funcs/ticketingGetAttachment.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingGetAttachment(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,ticket_id,remote_ticket_id,user_id,remote_user_id,file_name,file_format,file_url,size,created_at,updated_at,unified_custom_fields",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("ticketingGetAttachment failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingGetAttachmentRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingGetAttachmentResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getComment

Retrieve a single comment by its identifier for a ticket.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.getComment({
    prefer: "heartbeat",
    fields: "id,remote_id,ticket_id,remote_ticket_id,content,user_id,remote_user_id,internal,created_at,updated_at,unified_custom_fields",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingGetComment } from "@stackone/stackone-client-ts/funcs/ticketingGetComment.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingGetComment(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,ticket_id,remote_ticket_id,content,user_id,remote_user_id,internal,created_at,updated_at,unified_custom_fields",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("ticketingGetComment failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingGetCommentRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingGetCommentResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getProject

Retrieve a single project by its identifier.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.getProject({
    prefer: "heartbeat",
    fields: "id,remote_id,organization_id,remote_organization_id,name,description,created_at,updated_at,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingGetProject } from "@stackone/stackone-client-ts/funcs/ticketingGetProject.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingGetProject(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,organization_id,remote_organization_id,name,description,created_at,updated_at,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("ticketingGetProject failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingGetProjectRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingGetProjectResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getProjectComponent

Retrieve a single project component by its identifier.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.getProjectComponent({
    prefer: "heartbeat",
    fields: "id,remote_id,organization_id,remote_organization_id,project_id,remote_project_id,name,description,created_at,updated_at,unified_custom_fields",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingGetProjectComponent } from "@stackone/stackone-client-ts/funcs/ticketingGetProjectComponent.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingGetProjectComponent(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,organization_id,remote_organization_id,project_id,remote_project_id,name,description,created_at,updated_at,unified_custom_fields",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("ticketingGetProjectComponent failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingGetProjectComponentRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingGetProjectComponentResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getTicket

Retrieve a single ticket by its identifier.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.getTicket({
    prefer: "heartbeat",
    fields: "id,remote_id,type,ticket_number,title,creator_id,remote_creator_id,reporters,assignees,content,parent_id,remote_parent_id,closed_at,ticket_url,status,priority,tags,projects,components,organization,created_at,updated_at,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingGetTicket } from "@stackone/stackone-client-ts/funcs/ticketingGetTicket.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingGetTicket(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,type,ticket_number,title,creator_id,remote_creator_id,reporters,assignees,content,parent_id,remote_parent_id,closed_at,ticket_url,status,priority,tags,projects,components,organization,created_at,updated_at,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("ticketingGetTicket failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingGetTicketRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingGetTicketResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getTicketType

Retrieve a single ticket type by its identifier.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.getTicketType({
    prefer: "heartbeat",
    fields: "id,remote_id,name,project_id,remote_project_id,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingGetTicketType } from "@stackone/stackone-client-ts/funcs/ticketingGetTicketType.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingGetTicketType(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,name,project_id,remote_project_id,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("ticketingGetTicketType failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingGetTicketTypeRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingGetTicketTypeResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getUser

Retrieve a single user by their identifier.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.getUser({
    prefer: "heartbeat",
    fields: "id,remote_id,type,name,primary_email,primary_phone,username,active,first_name,last_name,customer_account_reference,created_at,updated_at,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingGetUser } from "@stackone/stackone-client-ts/funcs/ticketingGetUser.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingGetUser(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,type,name,primary_email,primary_phone,username,active,first_name,last_name,customer_account_reference,created_at,updated_at,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("ticketingGetUser failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingGetUserRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingGetUserResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listAttachments

Retrieve a paginated list of attachment details for a ticket.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.listAttachments({
    prefer: "heartbeat",
    fields: "id,remote_id,ticket_id,remote_ticket_id,user_id,remote_user_id,file_name,file_format,file_url,size,created_at,updated_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    id: "<id>",
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingListAttachments } from "@stackone/stackone-client-ts/funcs/ticketingListAttachments.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingListAttachments(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,ticket_id,remote_ticket_id,user_id,remote_user_id,file_name,file_format,file_url,size,created_at,updated_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    id: "<id>",
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("ticketingListAttachments failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingListAttachmentsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingListAttachmentsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listComments

Retrieve a paginated list of comments for a ticket.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.listComments({
    prefer: "heartbeat",
    fields: "id,remote_id,ticket_id,remote_ticket_id,content,user_id,remote_user_id,internal,created_at,updated_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    id: "<id>",
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingListComments } from "@stackone/stackone-client-ts/funcs/ticketingListComments.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingListComments(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,ticket_id,remote_ticket_id,content,user_id,remote_user_id,internal,created_at,updated_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    id: "<id>",
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("ticketingListComments failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingListCommentsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingListCommentsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listProjectComponents

Retrieve a paginated list of project components.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.listProjectComponents({
    prefer: "heartbeat",
    fields: "id,remote_id,organization_id,remote_organization_id,project_id,remote_project_id,name,description,created_at,updated_at,unified_custom_fields",
    filter: null,
    id: "<id>",
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingListProjectComponents } from "@stackone/stackone-client-ts/funcs/ticketingListProjectComponents.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingListProjectComponents(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,organization_id,remote_organization_id,project_id,remote_project_id,name,description,created_at,updated_at,unified_custom_fields",
    filter: null,
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("ticketingListProjectComponents failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingListProjectComponentsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingListProjectComponentsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listProjectTicketTypes

Retrieve a paginated list of ticket types for a project.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.listProjectTicketTypes({
    prefer: "heartbeat",
    fields: "id,remote_id,name,project_id,remote_project_id,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    id: "<id>",
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingListProjectTicketTypes } from "@stackone/stackone-client-ts/funcs/ticketingListProjectTicketTypes.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingListProjectTicketTypes(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,name,project_id,remote_project_id,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("ticketingListProjectTicketTypes failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingListProjectTicketTypesRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingListProjectTicketTypesResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listProjects

Retrieve a paginated list of projects.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.listProjects({
    prefer: "heartbeat",
    fields: "id,remote_id,organization_id,remote_organization_id,name,description,created_at,updated_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingListProjects } from "@stackone/stackone-client-ts/funcs/ticketingListProjects.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingListProjects(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,organization_id,remote_organization_id,name,description,created_at,updated_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("ticketingListProjects failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingListProjectsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingListProjectsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listTicketStatuses

Retrieve a paginated list of statuses for a ticket.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.listTicketStatuses({
    prefer: "heartbeat",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    id: "<id>",
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingListTicketStatuses } from "@stackone/stackone-client-ts/funcs/ticketingListTicketStatuses.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingListTicketStatuses(stackOne, {
    prefer: "heartbeat",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    id: "<id>",
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("ticketingListTicketStatuses failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingListTicketStatusesRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingListTicketStatusesResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listTicketTypes

Retrieve a paginated list of all ticket types.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.listTicketTypes({
    prefer: "heartbeat",
    fields: "id,remote_id,name,project_id,remote_project_id,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingListTicketTypes } from "@stackone/stackone-client-ts/funcs/ticketingListTicketTypes.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingListTicketTypes(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,name,project_id,remote_project_id,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("ticketingListTicketTypes failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingListTicketTypesRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingListTicketTypesResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listTickets

Retrieve a paginated list of tickets.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.listTickets({
    prefer: "heartbeat",
    fields: "id,remote_id,type,ticket_number,title,creator_id,remote_creator_id,reporters,assignees,content,parent_id,remote_parent_id,closed_at,ticket_url,status,priority,tags,projects,components,organization,created_at,updated_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingListTickets } from "@stackone/stackone-client-ts/funcs/ticketingListTickets.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingListTickets(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,type,ticket_number,title,creator_id,remote_creator_id,reporters,assignees,content,parent_id,remote_parent_id,closed_at,ticket_url,status,priority,tags,projects,components,organization,created_at,updated_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("ticketingListTickets failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingListTicketsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingListTicketsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listUsers

Retrieve a paginated list of users.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.listUsers({
    prefer: "heartbeat",
    fields: "id,remote_id,type,name,primary_email,primary_phone,username,active,first_name,last_name,customer_account_reference,created_at,updated_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingListUsers } from "@stackone/stackone-client-ts/funcs/ticketingListUsers.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingListUsers(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,type,name,primary_email,primary_phone,username,active,first_name,last_name,customer_account_reference,created_at,updated_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("ticketingListUsers failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingListUsersRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingListUsersResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

updateTicket

Update an existing ticket record by its identifier.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";
import {
  TicketingTicketUpdateRequestDtoSchemasValue,
  TicketingTicketUpdateRequestDtoValue,
} from "@stackone/stackone-client-ts/sdk/models/shared";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.ticketing.updateTicket({
    prefer: "heartbeat",
    ticketingTicketUpdateRequestDto: {
      assignees: [
        "user-001",
        "user-002",
      ],
      componentIds: "[\"component-001\",\"component-002\"]",
      content: [
        {
          html: "<p>This is some content</p>",
          plain: "This is some content",
        },
        {
          html: "<p>This is some content</p>",
          plain: "This is some content",
        },
      ],
      parentId: "ticket-002",
      priority: {
        id: "001",
        sourceValue: "Normal",
        value: TicketingTicketUpdateRequestDtoValue.Medium,
      },
      projectId: "project-001",
      reporters: [
        "user-001",
        "user-002",
      ],
      status: {
        id: "001",
        name: "Backlog",
        type: {
          sourceValue: "New",
          value: TicketingTicketUpdateRequestDtoSchemasValue.ToDo,
        },
      },
      tags: [
        "tag-001",
        "tag-002",
      ],
      title: "System outage in production environment",
      unifiedCustomFields: {
        "my_project_custom_field_1": "REF-1236",
        "my_project_custom_field_2": "some other value",
      },
    },
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { ticketingUpdateTicket } from "@stackone/stackone-client-ts/funcs/ticketingUpdateTicket.js";
import {
  TicketingTicketUpdateRequestDtoSchemasValue,
  TicketingTicketUpdateRequestDtoValue,
} from "@stackone/stackone-client-ts/sdk/models/shared";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await ticketingUpdateTicket(stackOne, {
    prefer: "heartbeat",
    ticketingTicketUpdateRequestDto: {
      assignees: [
        "user-001",
        "user-002",
      ],
      componentIds: "[\"component-001\",\"component-002\"]",
      content: [
        {
          html: "<p>This is some content</p>",
          plain: "This is some content",
        },
        {
          html: "<p>This is some content</p>",
          plain: "This is some content",
        },
      ],
      parentId: "ticket-002",
      priority: {
        id: "001",
        sourceValue: "Normal",
        value: TicketingTicketUpdateRequestDtoValue.Medium,
      },
      projectId: "project-001",
      reporters: [
        "user-001",
        "user-002",
      ],
      status: {
        id: "001",
        name: "Backlog",
        type: {
          sourceValue: "New",
          value: TicketingTicketUpdateRequestDtoSchemasValue.ToDo,
        },
      },
      tags: [
        "tag-001",
        "tag-002",
      ],
      title: "System outage in production environment",
      unifiedCustomFields: {
        "my_project_custom_field_1": "REF-1236",
        "my_project_custom_field_2": "some other value",
      },
    },
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("ticketingUpdateTicket failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TicketingUpdateTicketRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TicketingUpdateTicketResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*