Base class for all Shortcut resources. Provides methods for creating, updating, and deleting resources.

Hierarchy (view full)

Implements

Constructors

Properties

appUrl: string
archived: boolean
associatedGroups: []
availableOperations: ResourceOperation[] = []

The available operations for the resource, any not in this list will raise an error when called

changedFields: string[] = []

Fields that have been changed, used to determine what to update. It is not recommended to access this property directly.

completed: boolean
completedAt: null | string
completedAtOverride: null | string
createFields: string[] = ...

Fields that are used when creating a new resource

deadline: null | string
description: string
entityType: string
epicStateId: number
externalId: null | string
followerIds: string[]
groupIds: string[]
id: number
labelIds: number[]
labels: []
memberMentionIds: string[]
mentionIds: string[]
milestoneId: null | number
name: string
objectiveIds: number[]
ownerIds: string[]
plannedStartDate: null | string
position: number
productboardId: null | string
productboardName: null | string
productboardPluginId: null | string
productboardUrl: null | string
projectIds: number[]
requestedById: string
service: BaseService<BaseResource<default>, default> | BaseSearchableService<BaseResource<default>, default>
started: boolean
startedAt: null | string
startedAtOverride: null | string
stats: object
storiesWithoutProjects: number
updatedAt: null | string
baseUrl: string = 'https://api.app.shortcut.com/api/v3/epics'

Accessors

  • get teams(): Promise<Team[]>
  • Get the teams assigned to the story, labelled as "Group" in the Shortcut API

    Returns Promise<Team[]>

Methods

  • Protected

    This method can be overridden by derived classes to perform any necessary operations before saving the resource

    Returns Promise<void>

  • Add a comment to the epic authored by the user associated with the API key currently in use

    Parameters

    • comment: string

    Returns Promise<void | ThreadedCommentInterface>

    Example

    const epic = new Epic({id: 123})
    epic.comment('This is a comment').then((comment) => {
    console.log(comment)
    })
  • Create a new instance of the resource, using the current object's properties. Use the xCreateData interface to determine which fields are available for creation.

    Returns Promise<Epic>

    • A Promise that resolves with the newly created instance.

    Throws

    • Throws an error if the HTTP request fails.
  • Delete the current instance of the resource.

    Returns Promise<void>

    • A Promise that resolves when the resource has been deleted.

    Throws

    • Throws an error if the HTTP request fails.
  • Save the current instance of the resource. If the resource already exists (has an ID), it will be updated. Otherwise, it will be created using the fields createFields.

    Returns Promise<void>

  • Update the current instance of the resource with the changed fields.

    Returns Promise<void>

    • A Promise that resolves when the resource has been updated.

    Throws

    • Throws an error if the HTTP request fails.