feat: add work-queue skill for Marcus and Steve
Some checks failed
ci / build-test-push (push) Failing after 29s
Some checks failed
ci / build-test-push (push) Failing after 29s
This commit is contained in:
40
skill/bin/wq_update
Executable file
40
skill/bin/wq_update
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
# wq_update — update status, outcome, or notes
|
||||
|
||||
wq_update() {
|
||||
local work_id status outcome notes
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--status) status="$2"; shift 2;;
|
||||
--outcome) outcome="$2"; shift 2;;
|
||||
--notes) notes="$2"; shift 2;;
|
||||
--) shift; break;;
|
||||
-*) echo "Unknown option: $1" >&2; exit 1;;
|
||||
*)
|
||||
if [[ -z "$work_id" ]]; then
|
||||
work_id="$1"
|
||||
fi
|
||||
shift;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -z "$work_id" ]]; then
|
||||
echo "Usage: wq update <work_item_id> [--status <status>] [--outcome <success|failed|cancelled>] [--notes <text>]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "$status" ]] && [[ -z "$outcome" ]] && [[ -z "$notes" ]]; then
|
||||
echo "Error: at least one of --status, --outcome, or --notes required" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local body="{}"
|
||||
[[ -n "$status" ]] && body=$(echo "$body" | jq ".status=\"$status\"")
|
||||
[[ -n "$outcome" ]] && body=$(echo "$body" | jq ".outcome=\"$outcome\"")
|
||||
[[ -n "$notes" ]] && body=$(echo "$body" | jq ".notes=\"$notes\"")
|
||||
|
||||
curl -sf -X PATCH "$API_URL/work/$work_id" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$body" | jq .
|
||||
}
|
||||
Reference in New Issue
Block a user