View Source ShortcutApi.Epics (shortcut_api_ex v1.0.5)

API wrapper for Shortcut Epics endpoints. See: https://developer.shortcut.com/api/rest/v3#Epics

All functions require a valid Shortcut API token.

Summary

Functions

Creates a new epic.

Deletes an epic.

Retrieves a single epic by ID.

Get details about a specific epic state.

Get statistics for a specific epic.

Get the epic workflow state.

Lists all epics.

Updates an existing epic.

Types

epic_id()

@type epic_id() :: pos_integer()

response()

@type response() :: {:ok, map() | [map()]} | {:error, any()}

token()

@type token() :: String.t()

Functions

create_epic(token, params)

@spec create_epic(token(), map()) :: response()

Creates a new epic.

Parameters

  • token - Shortcut API token
  • params - Map containing the epic parameters

Required params

  • :name - Epic name
  • :workflow_state_id - The ID of the workflow state

Examples

iex> params = %{name: "New Epic", workflow_state_id: 123}
iex> ShortcutApi.Epics.create_epic("token", params)
{:ok, %{id: 12345, name: "New Epic"}}

delete_epic(token, epic_id)

@spec delete_epic(token(), epic_id()) :: response()

Deletes an epic.

Parameters

  • token - Shortcut API token
  • epic_id - The ID of the epic to delete

Examples

iex> ShortcutApi.Epics.delete_epic("token", 12345)
{:ok, %{}}

get_epic(token, epic_id)

@spec get_epic(token(), epic_id()) :: response()

Retrieves a single epic by ID.

Parameters

  • token - Shortcut API token
  • epic_id - The ID of the epic to retrieve

Examples

iex> ShortcutApi.Epics.get_epic("token", 12345)
{:ok, %{id: 12345, name: "Epic name"}}

get_epic_state(token, state_id)

@spec get_epic_state(token(), pos_integer()) :: response()

Get details about a specific epic state.

Parameters

  • token - Shortcut API token
  • state_id - The ID of the epic state to retrieve

Examples

iex> ShortcutApi.Epics.get_epic_state("token", 12345)
{:ok, %{id: 12345, name: "In Progress", ...}}

get_epic_stats(token, epic_id)

@spec get_epic_stats(token(), epic_id()) :: response()

Get statistics for a specific epic.

Parameters

  • token - Shortcut API token
  • epic_id - The ID of the epic to get stats for

Examples

iex> ShortcutApi.Epics.get_epic_stats("token", 12345)
{:ok, %{num_points: 10, num_stories: 5, ...}}

get_epic_workflow(token)

@spec get_epic_workflow(token()) :: response()

Get the epic workflow state.

Parameters

  • token - Shortcut API token

Examples

iex> ShortcutApi.Epics.get_epic_workflow("token")
{:ok, %{states: [%{id: 123, name: "In Progress"}, ...]}}

list_epics(token)

@spec list_epics(token()) :: response()

Lists all epics.

Parameters

  • token - Shortcut API token

Examples

iex> ShortcutApi.Epics.list_epics("token")
{:ok, [%{id: 12345, name: "Epic name"}, ...]}

update_epic(token, epic_id, params)

@spec update_epic(token(), epic_id(), map()) :: response()

Updates an existing epic.

Parameters

  • token - Shortcut API token
  • epic_id - The ID of the epic to update
  • params - Map containing the update parameters

Examples

iex> params = %{name: "Updated Epic Name"}
iex> ShortcutApi.Epics.update_epic("token", 12345, params)
{:ok, %{id: 12345, name: "Updated Epic Name", ...}}