jira-pat
Manage Jira issues on self-hosted/enterprise instances using Personal Access Tokens (PAT). Use this skill when working with Jira that uses SSO/SAML authentication where Basic Auth fails.
What this skill does
# Jira PAT Skill
This skill provides patterns for interacting with Jira REST API using Personal Access Tokens (PAT).
## Prerequisites
1. **Personal Access Token (PAT)**: Create one in Jira:
- Go to your Jira profile → Personal Access Tokens
- Create a new token with appropriate permissions
- Store it securely (e.g., in environment variable `JIRA_PAT`)
2. **Jira Base URL**: Your Jira instance URL (e.g., `https://issues.redhat.com`)
## Environment Setup
```bash
# Set these in your shell or .bashrc/.zshrc
export JIRA_PAT="your-personal-access-token"
export JIRA_URL="https://issues.redhat.com"
```
## Common Operations
### Get Issue Details
Fetch full details of a Jira issue by its key:
```bash
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/issue/TC-3494" | jq
```
Get specific fields only:
```bash
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/issue/TC-3494?fields=summary,status,description" | jq
```
### Search for Issues (JQL)
Search using JQL (Jira Query Language):
```bash
# Find all child issues of an epic
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/search?jql=parent=TC-3494" | jq
# Search with URL encoding for complex queries
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/search?jql=project%3DTCS%20AND%20status%3DOpen" | jq
```
Common JQL examples:
- `parent=EPIC-123` - Child issues of an epic
- `project=TCS AND status=Open` - Open issues in project
- `assignee=currentUser()` - Issues assigned to you
- `labels=security` - Issues with specific label
- `updated >= -7d` - Recently updated
### Get Available Transitions
Before changing issue status, get available transitions:
```bash
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/issue/TC-3496/transitions" | jq '.transitions[] | {id, name}'
```
Example output:
```json
{"id": "11", "name": "To Do"}
{"id": "21", "name": "In Progress"}
{"id": "31", "name": "In Review"}
{"id": "41", "name": "Done"}
{"id": "61", "name": "Closed"}
```
### Transition (Change Status) an Issue
Close an issue with a comment:
```bash
curl -s -X POST \
-H "Authorization: Bearer $JIRA_PAT" \
-H "Content-Type: application/json" \
-d '{
"transition": {"id": "61"},
"update": {
"comment": [
{"add": {"body": "Closed via API. Implementation complete in PR #123."}}
]
}
}' \
"$JIRA_URL/rest/api/2/issue/TC-3496/transitions"
```
Move to "In Progress" without comment:
```bash
curl -s -X POST \
-H "Authorization: Bearer $JIRA_PAT" \
-H "Content-Type: application/json" \
-d '{"transition": {"id": "21"}}' \
"$JIRA_URL/rest/api/2/issue/TC-3496/transitions"
```
### Add a Comment
```bash
curl -s -X POST \
-H "Authorization: Bearer $JIRA_PAT" \
-H "Content-Type: application/json" \
-d '{"body": "This is a comment added via API."}' \
"$JIRA_URL/rest/api/2/issue/TC-3496/comment"
```
### Update Issue Fields
```bash
curl -s -X PUT \
-H "Authorization: Bearer $JIRA_PAT" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"summary": "Updated summary",
"labels": ["api", "security"]
}
}' \
"$JIRA_URL/rest/api/2/issue/TC-3496"
```
### Create an Issue
```bash
curl -s -X POST \
-H "Authorization: Bearer $JIRA_PAT" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"project": {"key": "TCS"},
"summary": "New issue created via API",
"description": "Issue description here",
"issuetype": {"name": "Task"},
"parent": {"key": "TC-3494"}
}
}' \
"$JIRA_URL/rest/api/2/issue"
```
## Useful jq Filters
```bash
# Get just summary and status
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/issue/TC-3494" | \
jq '{key: .key, summary: .fields.summary, status: .fields.status.name}'
# List all child issues with status
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/search?jql=parent=TC-3494" | \
jq '.issues[] | {key: .key, summary: .fields.summary, status: .fields.status.name}'
# Get issue links
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/issue/TC-3494" | \
jq '.fields.issuelinks[] | {type: .type.name, key: (.inwardIssue // .outwardIssue).key}'
```
## Shell Functions
Add these to your `.bashrc` or `.zshrc` for convenience:
```bash
# Get issue details
jira-get() {
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/issue/$1" | jq
}
# Get issue summary
jira-summary() {
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/issue/$1" | \
jq -r '"\(.key): \(.fields.summary) [\(.fields.status.name)]"'
}
# Search issues
jira-search() {
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/search?jql=$1" | \
jq '.issues[] | "\(.key): \(.fields.summary) [\(.fields.status.name)]"' -r
}
# List epic children
jira-children() {
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/search?jql=parent=$1" | \
jq '.issues[] | "\(.key): \(.fields.summary) [\(.fields.status.name)]"' -r
}
# Get available transitions
jira-transitions() {
curl -s -H "Authorization: Bearer $JIRA_PAT" \
"$JIRA_URL/rest/api/2/issue/$1/transitions" | \
jq '.transitions[] | "\(.id): \(.name)"' -r
}
# Close an issue
jira-close() {
local issue=$1
local comment=${2:-"Closed via API"}
curl -s -X POST \
-H "Authorization: Bearer $JIRA_PAT" \
-H "Content-Type: application/json" \
-d "{\"transition\": {\"id\": \"61\"}, \"update\": {\"comment\": [{\"add\": {\"body\": \"$comment\"}}]}}" \
"$JIRA_URL/rest/api/2/issue/$issue/transitions"
echo "Closed $issue"
}
```
Usage:
```bash
jira-get TC-3494
jira-summary TC-3601
jira-search "project=TCS AND status=Open"
jira-children TC-3494
jira-transitions TC-3496
jira-close TC-3496 "Completed in PR #123"
```
## Troubleshooting
### 401 Unauthorized
- Verify your PAT is valid and not expired
- Check the Authorization header format: `Bearer <token>` (not `Bearer: <token>`)
### 404 Not Found
- Verify the issue key exists
- Check you have permission to view the issue
### 400 Bad Request on Transition
- Get available transitions first - transition IDs vary by workflow
- Some transitions require specific fields or conditions
## Notes
- The jira-cli tool (`jira`) doesn't work well with self-hosted Jira instances using SSO
- Direct curl with PAT is more reliable for self-hosted Jira
- Always URL-encode JQL queries when using special characters
- Transition IDs are workflow-specific - always query them first
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.