capabilities.work

Sweep a Stale Issue Through a Transition

A 4-step recipe with Jira. We can help you get access.

Recipe · 4 steps

Sweep a Stale Issue Through a Transition

with Jira
Works with AI assistants

Select a stale Jira issue by JQL, comment on it, and transition it closed.

  1. Run the stale-issue JQL query via POST and take the first match. The query is validated strictly so a malformed query fails loudly instead of silently sweeping the wrong issues.
  2. Leave an audit trail on the issue before it is closed, so the record of why it was swept survives the transition.
  3. Discover the transitions available on the stale issue from its current status, rather than assuming a fixed transition id across projects.
  4. Perform the closing transition with a resolution. This operation returns 204 with no body on success.
What you'll need to have ready
  • jql: The JQL query selecting stale issues, e.g. project = PROJ AND resolution = Unresolved AND updated < -90d ORDER BY updated ASC.
  • transitionId: The id of the closing transition to perform, selected from the transitions discovered by the listTransitions step.
  • auditText: The plain text audit comment explaining why the issue is being closed automatically.
  • resolutionName: The name of the resolution to set during the transition (e.g. "Won't Do").
For your developer

Arazzo workflow jira:stale-issue-sweep, 4 operations: postRestApi3Search → postRestApi3IssueByIssueIdOrKeyComment → getTransitions → doTransition. Specs on APIs.io.