Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions scripts/lib/jira-triage-ops.lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,20 @@
[[ -n "${JIRA_TRIAGE_OPS_SH_LOADED:-}" ]] && return 0
JIRA_TRIAGE_OPS_SH_LOADED=1

_jira_require_vars() {
if [[ -z "${JIRA_BASE_URL:-}" ]]; then echo "ERROR: JIRA_BASE_URL is not set" >&2; exit 1; fi
Comment thread
ralphbean marked this conversation as resolved.
Outdated
if [[ -z "${JIRA_USER_EMAIL:-}" ]]; then echo "ERROR: JIRA_USER_EMAIL is not set" >&2; exit 1; fi
if [[ -z "${JIRA_TOKEN:-}" ]]; then echo "ERROR: JIRA_TOKEN is not set" >&2; exit 1; fi
}

_jira_api() {
local method="$1"
shift
local endpoint="$1"
shift

_jira_require_vars

curl --fail --silent --show-error \
--connect-timeout 10 --max-time 30 \
--user "${JIRA_USER_EMAIL}:${JIRA_TOKEN}" \
Expand All @@ -58,6 +67,9 @@ _jira_api_with_status() {
shift
local endpoint="$1"
shift

_jira_require_vars

local err_file
err_file=$(mktemp)
local raw
Expand Down
Loading