Sentry issues over the organization-scoped endpoints: search with Sentry's query syntax, read, update one or many, list events, read the latest event's stack trace, and comment.

Context Vars

Optional
  • sentry.token
  • sentry.org

Values

MAX_BULK_IDS

MAX_BULK_IDS: Int 1000

Functions

add-comment

fn (issue-id: Any, text: Str): Map
fn (issue-id: Any, text: Str, opts: Map): Map

POST /organizations/{org}/issues/{id}/comments/ - Comment on an issue. Sentry attributes comments to a user, so this needs a user auth token (organization auth tokens are rejected with 403).

Example

comment ::sentry::issues/add-comment("4501", "Fixed in the next deploy.")
comment.id

assign-issue

fn (issue-id: Any, assignee: Str): Map
fn (issue-id: Any, assignee: Str, opts: Map): Map

Assign an issue: "user:<id>", "team:<id>", a username, or an email. Pass "" to unassign.

Example

::sentry::issues/assign-issue("4501", "team:12")

// Unassign
::sentry::issues/assign-issue("4501", "")

bulk-query

fn (issue-ids: Vec, params: Map): Str

The query string for a bulk update: one id= per issue, plus optional project/environment filters. Exposed for testing.

Example

::sentry::issues/bulk-query(["4501", "4502"], {})  // "?id=4501&id=4502"

bulk-update-issues

fn (issue-ids: Vec, changes: Map): Any
fn (issue-ids: Vec, changes: Map, params: Map): Any
fn (issue-ids: Vec, changes: Map, params: Map, opts: Map): Any

PUT /organizations/{org}/issues/?id=… - Apply the same changes (as in update-issue, plus merge: true / discard: true) to up to 1000 issues. issue-ids must be non-empty: without ids Sentry would update every issue matching the filters, so this function refuses. Returns Sentry's summary of the change (null when nothing matched).

Example

::sentry::issues/bulk-update-issues(["4501", "4502"], {status: "resolved"})

get-event

fn (issue-id: Any, event-id: Str): Map
fn (issue-id: Any, event-id: Str, params: Map): Map
fn (issue-id: Any, event-id: Str, params: Map, opts: Map): Map

GET /organizations/{org}/issues/{id}/events/{event_id}/ - One event of an issue, with stack trace entries, tags, and context. event-id may be "latest", "oldest", or "recommended".

Example

event ::sentry::issues/get-event("4501", "recommended", {environment: "production"})
event.entries

get-issue

fn (issue-id: Any): Map
fn (issue-id: Any, opts: Map): Map

GET /organizations/{org}/issues/{id}/ - One issue: title, culprit, status, level, counts, assignee, first/last seen.

Example

issue ::sentry::issues/get-issue("4501")
issue.title
issue.status

get-latest-event

fn (issue-id: Any): Map
fn (issue-id: Any, environment: Str): Map
fn (issue-id: Any, opts: Map): Map
fn (issue-id: Any, environment: Str?, opts: Map): Map

The issue's most recent event, including the stack trace entries. The 2-arity form filters by environment.

Example

event ::sentry::issues/get-latest-event("4501", "production")
event.entries

ignore-issue

fn (issue-id: Any): Map
fn (issue-id: Any, minutes: Int): Map
fn (issue-id: Any, opts: Map): Map
fn (issue-id: Any, minutes: Int, opts: Map): Map

Archive (ignore) an issue. The 2-arity form archives it for minutes, after which it returns.

Example

::sentry::issues/ignore-issue("4501")

// Archive for one hour
::sentry::issues/ignore-issue("4501", 60)

list-all-issues

fn (params: Map): Vec
fn (params: Map, max: Int): Vec
fn (params: Map, opts: Map): Vec
fn (params: Map, max: Int, opts: Map): Vec

Every issue matching params, following cursors (100 per request) up to max (default 1000).

Example

issues ::sentry::issues/list-all-issues({project: "my-api", query: "is:unresolved level:error"}, 300)
map(issues, %.title)

list-comments

fn (issue-id: Any): Vec
fn (issue-id: Any, opts: Map): Vec

GET /organizations/{org}/issues/{id}/comments/ - An issue's comments (notes), newest first: [{id, data: {text}, user, dateCreated}].

Example

comments ::sentry::issues/list-comments("4501")
map(comments, %.data.text)

list-issue-events

fn (issue-id: Any): ::sentry::api/Page
fn (issue-id: Any, params: Map): ::sentry::api/Page
fn (issue-id: Any, params: Map, opts: Map): ::sentry::api/Page

GET /organizations/{org}/issues/{id}/events/ - One page of an issue's events, newest first. params: full (true for stack traces and breadcrumbs), environment, statsPeriod or start/end, query, per_page, cursor. Returns a Page.

Example

page ::sentry::issues/list-issue-events("4501", {full: true, environment: "production", per_page: 10})
map(page.items, %.eventID)

list-issues

fn (): ::sentry::api/Page
fn (params: Map): ::sentry::api/Page
fn (project: Str, query: Str): ::sentry::api/Page
fn (params: Map, opts: Map): ::sentry::api/Page
fn (project: Str, query: Str, opts: Map): ::sentry::api/Page

GET /organizations/{org}/issues/ - One page of issues. params:

  • project — a project slug or numeric id, or a Vec of them (omit for all projects)
  • query — Sentry search syntax, e.g. "is:unresolved level:error firstSeen:-24h" (Sentry defaults to is:unresolved; "" returns everything)
  • statsPeriod ("24h", "14d") or start / end (ISO-8601)
  • environment — a name or Vec of names
  • sort — date, new, freq, user, trends, inbox, recommended
  • limit (max 100), cursor, expand, collapse

The 2-arity form is a shorthand for {project, query}. Returns a Page (.items, .next_cursor).

Example

page ::sentry::issues/list-issues({project: "my-api", query: "is:unresolved", sort: "freq", limit: 25})
map(page.items, %.title)

resolve-issue

fn (issue-id: Any): Map
fn (issue-id: Any, release: Str): Map
fn (issue-id: Any, opts: Map): Map
fn (issue-id: Any, release: Str?, opts: Map): Map

Mark an issue resolved. The 2-arity form resolves it in a release (statusDetails.inRelease), so a regression in a later release reopens it.

Example

::sentry::issues/resolve-issue("4501")

// Reopen on a regression after this release
::sentry::issues/resolve-issue("4501", "my-api@1.4.0")

unresolve-issue

fn (issue-id: Any): Map
fn (issue-id: Any, opts: Map): Map

Reopen an issue.

Example

::sentry::issues/unresolve-issue("4501")

update-issue

fn (issue-id: Any, changes: Map): Map
fn (issue-id: Any, changes: Map, opts: Map): Map

PUT /organizations/{org}/issues/{id}/ - Change only the given fields: status (resolved, unresolved, ignored, resolvedInNextRelease), substatus, statusDetails (e.g. {inRelease: "1.4.0"}), assignedTo ("user:<id>", "team:<id>", a username or email; "" unassigns), priority (low, medium, high), hasSeen, isBookmarked, isSubscribed, isPublic. Null fields are dropped.

Example

issue ::sentry::issues/update-issue("4501", {priority: "high", isBookmarked: true})
issue.priority