|
| 1 | +# acli Jira Command Reference |
| 2 | + |
| 3 | +Cheat sheet for `acli jira` commands. For full flag details, run `acli jira <subcommand> --help`. |
| 4 | + |
| 5 | +## Key Syntax Rules |
| 6 | + |
| 7 | +1. **`view` takes a positional arg.** Everything else uses `--key`. |
| 8 | +2. **Always pass `--yes`** on mutating commands (`edit`, `transition`, `assign`, `link create`) to skip interactive prompts. |
| 9 | +3. **Use `--json`** when you need fields beyond `key`, `summary`, `status`, `assignee`, `issuetype`, `priority`, `description`. The `--fields` flag rejects `components`, `sprint`, `labels`, `fixVersions`. |
| 10 | +4. **Use `--csv`** for search results you want to pipe or parse. |
| 11 | +5. **Use `--paginate`** to fetch all results beyond the default page size. |
| 12 | + |
| 13 | +## Work Items |
| 14 | + |
| 15 | +### Search |
| 16 | + |
| 17 | +```bash |
| 18 | +# JQL search with field selection |
| 19 | +acli jira workitem search --jql "project = RHIDP AND status = 'In Progress'" --fields "key,summary,status,assignee" --limit 50 |
| 20 | + |
| 21 | +# JSON output for full field data |
| 22 | +acli jira workitem search --jql "project = RHIDP" --limit 20 --json |
| 23 | + |
| 24 | +# Count only |
| 25 | +acli jira workitem search --jql "project = RHDHBUGS AND status not in (Closed)" --count |
| 26 | + |
| 27 | +# CSV export |
| 28 | +acli jira workitem search --jql "project = RHIDP" --fields "key,summary,status" --csv |
| 29 | + |
| 30 | +# Fetch all results (paginated) |
| 31 | +acli jira workitem search --jql "project = RHIDP AND sprint in openSprints()" --paginate |
| 32 | +``` |
| 33 | + |
| 34 | +### View |
| 35 | + |
| 36 | +```bash |
| 37 | +# View issue (positional arg — NOT --key) |
| 38 | +acli jira workitem view RHIDP-123 |
| 39 | + |
| 40 | +# Specific fields |
| 41 | +acli jira workitem view RHIDP-123 --fields "summary,description,status" |
| 42 | + |
| 43 | +# All fields |
| 44 | +acli jira workitem view RHIDP-123 --fields "*all" |
| 45 | + |
| 46 | +# JSON for full data (components, sprint, custom fields) |
| 47 | +acli jira workitem view RHIDP-123 --json |
| 48 | + |
| 49 | +# Open in browser |
| 50 | +acli jira workitem view RHIDP-123 --web |
| 51 | +``` |
| 52 | + |
| 53 | +### Create |
| 54 | + |
| 55 | +```bash |
| 56 | +# Basic creation |
| 57 | +acli jira workitem create --project RHIDP --type Story --summary "Implement auth plugin" --description "As a user..." --assignee "@me" |
| 58 | + |
| 59 | +# With labels |
| 60 | +acli jira workitem create --project RHDHBUGS --type Bug --summary "Login fails" --label "rhdh-customer,ci-fail" |
| 61 | + |
| 62 | +# With parent (sub-task or child of epic) |
| 63 | +acli jira workitem create --project RHIDP --type Task --summary "Write tests" --parent RHIDP-12968 |
| 64 | + |
| 65 | +# From JSON file (complex issues) |
| 66 | +acli jira workitem create --from-json workitem.json --project RHIDP --type Epic |
| 67 | + |
| 68 | +# Generate JSON template |
| 69 | +acli jira workitem create --generate-json |
| 70 | + |
| 71 | +# From description file |
| 72 | +acli jira workitem create --project RHIDP --type Story --summary "New feature" --description-file story.txt |
| 73 | +``` |
| 74 | + |
| 75 | +### Edit |
| 76 | + |
| 77 | +```bash |
| 78 | +# Edit summary (--key flag, NOT positional) |
| 79 | +acli jira workitem edit --key RHIDP-123 --summary "Updated summary" --yes |
| 80 | + |
| 81 | +# Edit multiple issues |
| 82 | +acli jira workitem edit --key "RHIDP-123,RHIDP-124" --assignee "jdoe@example.com" --yes |
| 83 | + |
| 84 | +# Edit by JQL (batch) |
| 85 | +acli jira workitem edit --jql "project = RHIDP AND labels = 'needs-info'" --labels "needs-pm" --yes |
| 86 | + |
| 87 | +# Add/remove labels |
| 88 | +acli jira workitem edit --key RHIDP-123 --labels "demo,test-day" --yes |
| 89 | +acli jira workitem edit --key RHIDP-123 --remove-labels "needs-info" --yes |
| 90 | + |
| 91 | +# Edit description from file |
| 92 | +acli jira workitem edit --key RHIDP-123 --description-file updated.txt --yes |
| 93 | + |
| 94 | +# Edit issue type |
| 95 | +acli jira workitem edit --key RHIDP-123 --type Task --yes |
| 96 | +``` |
| 97 | + |
| 98 | +### Transition |
| 99 | + |
| 100 | +```bash |
| 101 | +# Move to status (--key flag) |
| 102 | +acli jira workitem transition --key RHIDP-123 --status "In Progress" --yes |
| 103 | + |
| 104 | +# Batch transition by JQL |
| 105 | +acli jira workitem transition --jql "project = RHIDP AND status = 'Review'" --status "Closed" --yes |
| 106 | + |
| 107 | +# Ignore errors on batch (some may not have valid transition) |
| 108 | +acli jira workitem transition --jql "..." --status "To Do" --yes --ignore-errors |
| 109 | +``` |
| 110 | + |
| 111 | +### Assign |
| 112 | + |
| 113 | +```bash |
| 114 | +# Assign to self |
| 115 | +acli jira workitem assign --key RHIDP-123 --assignee "@me" --yes |
| 116 | + |
| 117 | +# Assign to user |
| 118 | +acli jira workitem assign --key RHIDP-123 --assignee "jdoe@example.com" --yes |
| 119 | + |
| 120 | +# Assign to project default |
| 121 | +acli jira workitem assign --key RHIDP-123 --assignee "default" --yes |
| 122 | +``` |
| 123 | + |
| 124 | +### Comment |
| 125 | + |
| 126 | +```bash |
| 127 | +# Add comment |
| 128 | +acli jira workitem comment create --key RHIDP-123 --body "Investigation complete. Root cause: ..." |
| 129 | + |
| 130 | +# List comments |
| 131 | +acli jira workitem comment list --key RHIDP-123 |
| 132 | + |
| 133 | +# Update comment |
| 134 | +acli jira workitem comment update --key RHIDP-123 --id 12345 --body "Updated findings" |
| 135 | + |
| 136 | +# Delete comment |
| 137 | +acli jira workitem comment delete --key RHIDP-123 --id 12345 |
| 138 | +``` |
| 139 | + |
| 140 | +### Links |
| 141 | + |
| 142 | +```bash |
| 143 | +# List available link types |
| 144 | +acli jira workitem link type |
| 145 | + |
| 146 | +# Create link (--out = source, --in = target) |
| 147 | +acli jira workitem link create --out RHIDP-123 --in RHIDP-456 --type "Blocks" --yes |
| 148 | + |
| 149 | +# List links on an issue |
| 150 | +acli jira workitem link list --key RHIDP-123 |
| 151 | + |
| 152 | +# Delete link (by link ID only, no --key needed) |
| 153 | +acli jira workitem link delete --id 12345 --yes |
| 154 | +``` |
| 155 | + |
| 156 | +### Attachments |
| 157 | + |
| 158 | +```bash |
| 159 | +# List attachments (note: attachment upload is not available via acli) |
| 160 | +acli jira workitem attachment list --key RHIDP-123 |
| 161 | + |
| 162 | +# Delete attachment |
| 163 | +acli jira workitem attachment delete --key RHIDP-123 --id 12345 |
| 164 | +``` |
| 165 | + |
| 166 | +## Boards |
| 167 | + |
| 168 | +```bash |
| 169 | +# Search boards by project |
| 170 | +acli jira board search --project RHIDP |
| 171 | + |
| 172 | +# Search by name |
| 173 | +acli jira board search --name "RHDH Cope" |
| 174 | + |
| 175 | +# Get board details |
| 176 | +acli jira board get --id 11374 |
| 177 | + |
| 178 | +# List sprints for a board (--id, NOT --board-id) |
| 179 | +acli jira board list-sprints --id 11374 |
| 180 | + |
| 181 | +# Active sprints only |
| 182 | +acli jira board list-sprints --id 11374 --state active |
| 183 | +``` |
| 184 | + |
| 185 | +## Sprints |
| 186 | + |
| 187 | +```bash |
| 188 | +# View sprint details |
| 189 | +acli jira sprint view --id 65456 |
| 190 | + |
| 191 | +# List work items in a sprint |
| 192 | +acli jira sprint list-workitems --sprint 65456 --board 11374 |
| 193 | + |
| 194 | +# Create sprint |
| 195 | +acli jira sprint create --name "RHDH COPE 3292" --board 11374 |
| 196 | +``` |
| 197 | + |
| 198 | +## Projects |
| 199 | + |
| 200 | +```bash |
| 201 | +# List recent projects |
| 202 | +acli jira project list --recent 10 |
| 203 | + |
| 204 | +# View project details |
| 205 | +acli jira project view --key RHIDP |
| 206 | +``` |
| 207 | + |
| 208 | +## Filters |
| 209 | + |
| 210 | +```bash |
| 211 | +# Search for saved filters |
| 212 | +acli jira filter search --name "RHDH" |
| 213 | + |
| 214 | +# List my/favourite filters |
| 215 | +acli jira filter list --my |
| 216 | +acli jira filter list --favourite |
| 217 | + |
| 218 | +# Get filter details (includes JQL) |
| 219 | +acli jira filter get --id 10001 |
| 220 | +``` |
| 221 | + |
| 222 | +## Output Format Differences |
| 223 | + |
| 224 | +| Behavior | Table (default) | `--json` | |
| 225 | +|----------|----------------|----------| |
| 226 | +| Description | Plain text | ADF (Atlassian Document Format) | |
| 227 | +| Team field | String name | Complex object `{id, name, avatarUrl, ...}` | |
| 228 | +| Sprint field | Not shown | Array of sprint objects | |
| 229 | +| Components | Not available via `--fields` | Full objects | |
| 230 | +| Labels | Not available via `--fields` | Array of strings | |
| 231 | +| Fix versions | Not available via `--fields` | Array of version objects | |
| 232 | + |
| 233 | +When writing descriptions, use `--description "plain text"`. When reading, be aware `--json` returns ADF — don't try to round-trip it. |
0 commit comments