#!/usr/bin/env bash SERVICE="" ISSUE_COUNT=5 ORG="" PROJECT_URL="https://app.getsentry.com/$ORG/$SERVICE" TOKEN="" echo "Sentry" echo "---" echo "$ORG / $SERVICE @ Sentry | href=$PROJECT_URL" echo "---" curl -s -X GET \ "https://sentry.io/api/0/projects/${ORG}/${SERVICE}/issues/?query=is%3Aunresolved&limit=${ISSUE_COUNT}&sort=date&statsPeriod=24h" \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer ${TOKEN}" | /usr/local/bin/jq -r ' def statusColor($issue): if $issue.status == "resolved" or $issue.status == "muted" then "green" elif $issue.status == "unresolved" and (isempty($issue.assignedTo) | not) then "orange" else "red" end; .[] | "\(.title) | length=72 href=\(.permalink) size=11 color=\(statusColor(.))", "Fields: | size=10", "--Status: \(.status) | size=10", "--Last Seen: \(.lastSeen) | size=10", "--First Seen: \(.firstSeen) | size=10", "--Occurrences: \(.count) | size=10", "\(.culprit) | length=72 size=10", "", "---", "" '