Skip to content

Instantly share code, notes, and snippets.

@fizz
Created March 2, 2026 05:57
Show Gist options
  • Select an option

  • Save fizz/2d2003bf7e4f67d7c3baf3b842181523 to your computer and use it in GitHub Desktop.

Select an option

Save fizz/2d2003bf7e4f67d7c3baf3b842181523 to your computer and use it in GitHub Desktop.
jira-status — structured JSON status reader for go-jira. Returns clean JSON instead of freeform text.
#!/usr/bin/env bash
# jira-status — structured JSON status reader for go-jira
#
# Returns a clean JSON object with key ticket fields instead of
# parsing go-jira's freeform text output. Ideal for scripting
# and AI agent consumption.
#
# Usage:
# jira-status NA-393
# jira-status NA-393 | jq -r .status
#
# Output:
# {"key":"NA-393","summary":"...","status":"In Progress",
# "assignee":"...","priority":"...","updated":"..."}
#
# Requires: go-jira, jq
set -euo pipefail
ticket="${1:?Usage: jira-status TICKET}"
jira view "$ticket" -t json | jq '{
key: .key,
summary: .fields.summary,
status: .fields.status.name,
assignee: (.fields.assignee.displayName // "unassigned"),
priority: .fields.priority.name,
updated: .fields.updated,
labels: .fields.labels,
due: (.fields.duedate // null)
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment