View Source ShortcutApi.Stories (shortcut_api_ex v1.0.5)

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

All functions require a valid Shortcut API token.

Summary

Functions

Creates a new story.

Retrieves a single story by ID.

Updates an existing story.

Types

response()

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

story_id()

@type story_id() :: pos_integer()

token()

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

Functions

create_story(token, params)

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

Creates a new story.

Parameters

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

Required params

  • :name - Story name
  • :project_id - Project ID

Examples

iex> params = %{name: "New Story", project_id: 123}
iex> ShortcutApi.Stories.create_story("token", params)
{:ok, %{id: 12345, name: "New Story"}}

delete_story(token, story_id)

@spec delete_story(token(), story_id()) :: response()

Deletes a story.

Parameters

  • token - Shortcut API token
  • story_id - The ID of the story to delete

Examples

iex> ShortcutApi.Stories.delete_story("token", 12345)
{:ok, %{}}

get_story(token, story_id)

@spec get_story(token(), story_id()) :: response()

Retrieves a single story by ID.

Parameters

  • token - Shortcut API token
  • story_id - The ID of the story to retrieve

Examples

iex> ShortcutApi.Stories.get_story("token", 12345)
{:ok, %{id: 12345, name: "Story name"}}

update_story(token, story_id, params)

@spec update_story(token(), story_id(), map()) :: response()

Updates an existing story.

Parameters

  • token - Shortcut API token
  • story_id - The ID of the story to update
  • params - Map containing the update parameters

Examples

iex> params = %{name: "Updated Story Name"}
iex> ShortcutApi.Stories.update_story("token", 12345, params)
{:ok, %{id: 12345, name: "Updated Story Name", ...}}