jiradc-cli 1.0.19 → 1.0.20-g329927f.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -6
- package/dist/index.js +184 -59
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -37,14 +37,17 @@ All commands output JSON. Add `--pretty` to pretty-print.
|
|
|
37
37
|
| `jiradc issue assign <key> <user>` | Assign issue (user can be a username, `me`, or `none` to unassign) |
|
|
38
38
|
| `jiradc issue transition <key>` | Transition issue to a new status (`--to` accepts ID or status name, `--comment` to add a note) |
|
|
39
39
|
| `jiradc issue transitions <key>` | List available transitions |
|
|
40
|
-
| `jiradc issue comment <key>` | Add a comment |
|
|
41
|
-
| `jiradc issue comment
|
|
40
|
+
| `jiradc issue comment add <key>` | Add a comment (`--body`) |
|
|
41
|
+
| `jiradc issue comment edit <key>` | Edit a comment (`--id`, `--body`) |
|
|
42
|
+
| `jiradc issue comment delete <key>` | Delete a comment (`--id`) |
|
|
42
43
|
| `jiradc issue link <key> <targetKey>` | Link two issues (`--type` link type name) |
|
|
43
44
|
| `jiradc issue unlink <linkId>` | Remove a link |
|
|
44
45
|
| `jiradc issue link-types` | List available link types |
|
|
45
46
|
| `jiradc issue link-epic <keys...>` | Link one or more issues to an epic (`--epic <epicKey>`) |
|
|
46
|
-
| `jiradc issue worklog <key>` | Add a work log entry |
|
|
47
|
-
| `jiradc issue
|
|
47
|
+
| `jiradc issue worklog add <key>` | Add a work log entry (`--time`, `--comment`, `--started`) |
|
|
48
|
+
| `jiradc issue worklog list <key>` | Get work log entries |
|
|
49
|
+
| `jiradc issue worklog edit <key>` | Update a work log entry (`--id`, `--time`, `--comment`, `--started`, `--adjust-estimate`, `--new-estimate`) |
|
|
50
|
+
| `jiradc issue worklog delete <key>` | Delete a work log entry (`--id`, `--adjust-estimate`, `--new-estimate`, `--increase-by`) |
|
|
48
51
|
| `jiradc issue changelog <key>` | Get issue changelog |
|
|
49
52
|
| `jiradc issue batch-changelog` | Get changelog for multiple issues (`--keys`) |
|
|
50
53
|
| `jiradc issue clone <key>` | Clone an issue with subtasks |
|
|
@@ -93,6 +96,7 @@ All commands output JSON. Add `--pretty` to pretty-print.
|
|
|
93
96
|
| `jiradc sprint issues <boardId> <sprintId>` | Get issues in a sprint |
|
|
94
97
|
| `jiradc sprint create <boardId>` | Create a sprint |
|
|
95
98
|
| `jiradc sprint update <sprintId>` | Update a sprint |
|
|
99
|
+
| `jiradc sprint delete <sprintId>` | Delete a sprint (returns its issues to the backlog) |
|
|
96
100
|
|
|
97
101
|
### field
|
|
98
102
|
|
|
@@ -151,13 +155,16 @@ jiradc issue update AI-123 --fix-versions 1.0,2.0
|
|
|
151
155
|
jiradc issue link-epic AI-456 AI-457 AI-458 --epic AI-100
|
|
152
156
|
|
|
153
157
|
# Add a comment
|
|
154
|
-
jiradc issue comment AI-123 --body "Fixed in commit abc123"
|
|
158
|
+
jiradc issue comment add AI-123 --body "Fixed in commit abc123"
|
|
159
|
+
|
|
160
|
+
# Delete a comment
|
|
161
|
+
jiradc issue comment delete AI-123 --id 12345
|
|
155
162
|
|
|
156
163
|
# Link two issues
|
|
157
164
|
jiradc issue link AI-123 AI-456 --type "blocks"
|
|
158
165
|
|
|
159
166
|
# Log work
|
|
160
|
-
jiradc issue worklog AI-123 --time "2h 30m" --comment "Code review"
|
|
167
|
+
jiradc issue worklog add AI-123 --time "2h 30m" --comment "Code review"
|
|
161
168
|
|
|
162
169
|
# List active sprints
|
|
163
170
|
jiradc sprint list 42 --state active
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { readFileSync } from "fs";
|
|
|
5
5
|
import { dirname, join as join4 } from "path";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
7
|
import { styleText } from "util";
|
|
8
|
-
import { Command as
|
|
8
|
+
import { Command as Command11 } from "commander";
|
|
9
9
|
|
|
10
10
|
// src/commands/board/issues.ts
|
|
11
11
|
import { Argument } from "commander";
|
|
@@ -379,8 +379,8 @@ function transformIssueFields(fields) {
|
|
|
379
379
|
issuelinks,
|
|
380
380
|
subtasks,
|
|
381
381
|
parent,
|
|
382
|
-
comment
|
|
383
|
-
worklog
|
|
382
|
+
comment,
|
|
383
|
+
worklog,
|
|
384
384
|
attachment,
|
|
385
385
|
// required scalars / structured fields we always keep verbatim
|
|
386
386
|
summary,
|
|
@@ -412,20 +412,20 @@ function transformIssueFields(fields) {
|
|
|
412
412
|
// Drop empty comment / worklog containers entirely. The default Jira
|
|
413
413
|
// search response includes both wrappers on every issue regardless of
|
|
414
414
|
// count; on a 25-issue page that's 25 × 2 empty objects of pure noise.
|
|
415
|
-
...
|
|
415
|
+
...comment && comment.comments.length > 0 ? {
|
|
416
416
|
comment: {
|
|
417
|
-
comments:
|
|
418
|
-
maxResults:
|
|
419
|
-
total:
|
|
420
|
-
startAt:
|
|
417
|
+
comments: comment.comments.map(transformComment),
|
|
418
|
+
maxResults: comment.maxResults,
|
|
419
|
+
total: comment.total,
|
|
420
|
+
startAt: comment.startAt
|
|
421
421
|
}
|
|
422
422
|
} : {},
|
|
423
|
-
...
|
|
423
|
+
...worklog && worklog.worklogs.length > 0 ? {
|
|
424
424
|
worklog: {
|
|
425
|
-
worklogs:
|
|
426
|
-
maxResults:
|
|
427
|
-
total:
|
|
428
|
-
startAt:
|
|
425
|
+
worklogs: worklog.worklogs.map(transformWorklog),
|
|
426
|
+
maxResults: worklog.maxResults,
|
|
427
|
+
total: worklog.total,
|
|
428
|
+
startAt: worklog.startAt
|
|
429
429
|
}
|
|
430
430
|
} : {},
|
|
431
431
|
...attachment && attachment.length > 0 ? { attachment: attachment.map(transformAttachment) } : {}
|
|
@@ -433,6 +433,33 @@ function transformIssueFields(fields) {
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
// src/utils/transformers/transition.ts
|
|
436
|
+
function slimAllowedValue(raw) {
|
|
437
|
+
if (!raw || typeof raw !== "object") return {};
|
|
438
|
+
const av = raw;
|
|
439
|
+
const slim = {};
|
|
440
|
+
if (typeof av.id === "string") slim.id = av.id;
|
|
441
|
+
if (typeof av.name === "string") slim.name = av.name;
|
|
442
|
+
if (typeof av.value === "string") slim.value = av.value;
|
|
443
|
+
return slim;
|
|
444
|
+
}
|
|
445
|
+
function slimField(raw) {
|
|
446
|
+
if (!raw || typeof raw !== "object") return {};
|
|
447
|
+
const field = raw;
|
|
448
|
+
const out = {};
|
|
449
|
+
if (typeof field.required === "boolean") out.required = field.required;
|
|
450
|
+
if (typeof field.name === "string") out.name = field.name;
|
|
451
|
+
if (Array.isArray(field.allowedValues)) {
|
|
452
|
+
out.allowedValues = field.allowedValues.map(slimAllowedValue);
|
|
453
|
+
}
|
|
454
|
+
return out;
|
|
455
|
+
}
|
|
456
|
+
function slimFields(fields) {
|
|
457
|
+
const out = {};
|
|
458
|
+
for (const [key, raw] of Object.entries(fields)) {
|
|
459
|
+
out[key] = slimField(raw);
|
|
460
|
+
}
|
|
461
|
+
return out;
|
|
462
|
+
}
|
|
436
463
|
function transformTransition(t) {
|
|
437
464
|
const out = {
|
|
438
465
|
id: t.id,
|
|
@@ -440,7 +467,7 @@ function transformTransition(t) {
|
|
|
440
467
|
to: t.to.name
|
|
441
468
|
};
|
|
442
469
|
if (t.fields && Object.keys(t.fields).length > 0) {
|
|
443
|
-
out.fields = t.fields;
|
|
470
|
+
out.fields = slimFields(t.fields);
|
|
444
471
|
}
|
|
445
472
|
return out;
|
|
446
473
|
}
|
|
@@ -1044,24 +1071,49 @@ Examples:
|
|
|
1044
1071
|
);
|
|
1045
1072
|
}
|
|
1046
1073
|
|
|
1047
|
-
// src/commands/issue/comment
|
|
1048
|
-
function
|
|
1049
|
-
parent.command("
|
|
1074
|
+
// src/commands/issue/comment/add.ts
|
|
1075
|
+
function add(parent) {
|
|
1076
|
+
parent.command("add <key>").description("Add a comment to an issue").requiredOption("--body <text>", "Comment body in wiki markup").addHelpText("after", '\nExamples:\n jiradc issue comment add PROJ-123 --body "Fixed in latest build"').action(async (key, opts) => {
|
|
1050
1077
|
const client = getClient();
|
|
1051
|
-
const result = await client.issues.
|
|
1078
|
+
const result = await client.issues.addComment({ issueKeyOrId: key, body: opts.body });
|
|
1052
1079
|
output(transformComment(result));
|
|
1053
1080
|
});
|
|
1054
1081
|
}
|
|
1055
1082
|
|
|
1056
|
-
// src/commands/issue/comment.ts
|
|
1057
|
-
function
|
|
1058
|
-
parent.command("
|
|
1083
|
+
// src/commands/issue/comment/delete.ts
|
|
1084
|
+
function deleteComment(parent) {
|
|
1085
|
+
parent.command("delete <key>").description("Delete a comment from an issue").requiredOption("--id <commentId>", "Comment ID to delete").addHelpText("after", "\nExamples:\n jiradc issue comment delete PROJ-123 --id 12345").action(async (key, opts) => {
|
|
1059
1086
|
const client = getClient();
|
|
1060
|
-
|
|
1087
|
+
await client.issues.deleteComment({ issueKeyOrId: key, commentId: opts.id });
|
|
1088
|
+
output({ deleted: true, issueKey: key, commentId: opts.id });
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
// src/commands/issue/comment/edit.ts
|
|
1093
|
+
function edit(parent) {
|
|
1094
|
+
parent.command("edit <key>").description("Edit an existing comment").requiredOption("--id <commentId>", "Comment ID to edit").requiredOption("--body <text>", "Updated comment body in wiki markup").addHelpText("after", '\nExamples:\n jiradc issue comment edit PROJ-123 --id 12345 --body "Updated comment text"').action(async (key, opts) => {
|
|
1095
|
+
const client = getClient();
|
|
1096
|
+
const result = await client.issues.editComment({ issueKeyOrId: key, commentId: opts.id, body: opts.body });
|
|
1061
1097
|
output(transformComment(result));
|
|
1062
1098
|
});
|
|
1063
1099
|
}
|
|
1064
1100
|
|
|
1101
|
+
// src/commands/issue/comment/index.ts
|
|
1102
|
+
function registerCommentCommands(parent) {
|
|
1103
|
+
const comment = parent.command("comment").description("Comment operations").addHelpText(
|
|
1104
|
+
"after",
|
|
1105
|
+
`
|
|
1106
|
+
Examples:
|
|
1107
|
+
$ jiradc issue comment add PROJ-123 --body "Fixed in latest build"
|
|
1108
|
+
$ jiradc issue comment edit PROJ-123 --id 12345 --body "Updated comment text"
|
|
1109
|
+
$ jiradc issue comment delete PROJ-123 --id 12345
|
|
1110
|
+
`
|
|
1111
|
+
);
|
|
1112
|
+
add(comment);
|
|
1113
|
+
edit(comment);
|
|
1114
|
+
deleteComment(comment);
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1065
1117
|
// src/commands/issue/create.ts
|
|
1066
1118
|
function create2(parent) {
|
|
1067
1119
|
parent.command("create").description("Create a new issue").requiredOption("--project <key>", "Project key or ID").requiredOption("--type <name>", "Issue type name (e.g., Task, Bug, Story)").requiredOption("--summary <text>", "Issue summary/title").option("--description <text>", "Issue description in wiki markup").option("--assignee <username>", "Assignee username").option("--reporter <username>", "Reporter username").option("--priority <name>", "Priority name (e.g., High, Medium, Low)").option("--labels <labels>", "Comma-separated labels").option("--components <names>", "Comma-separated component names").option("--fix-versions <versions>", "Comma-separated fix version names").option("--due-date <date>", "Due date in YYYY-MM-DD format").option("--parent <key>", "Parent issue key (for subtasks)").option("--custom-fields <json>", `Additional custom fields as JSON (e.g., '{"customfield_10100": "EPIC-1"}')`).addHelpText(
|
|
@@ -1186,22 +1238,6 @@ function devStatus(parent) {
|
|
|
1186
1238
|
});
|
|
1187
1239
|
}
|
|
1188
1240
|
|
|
1189
|
-
// src/commands/issue/get-worklog.ts
|
|
1190
|
-
function getWorklog(parent) {
|
|
1191
|
-
parent.command("get-worklog <key>").description("Get worklogs for an issue").option("--start <number>", "Starting index for pagination", nonNegativeInt).option("--limit <number>", "Max results per page (1-1000)", intInRange(1, 1e3), 25).addHelpText(
|
|
1192
|
-
"after",
|
|
1193
|
-
"\nExamples:\n jiradc issue get-worklog PROJ-123\n jiradc issue get-worklog PROJ-123 --limit 10\n jiradc issue get-worklog PROJ-123 --start 10 --limit 5"
|
|
1194
|
-
).action(async (key, opts) => {
|
|
1195
|
-
const client = getClient();
|
|
1196
|
-
const result = await client.issues.getWorklogs({
|
|
1197
|
-
issueKeyOrId: key,
|
|
1198
|
-
startAt: opts.start,
|
|
1199
|
-
maxResults: opts.limit
|
|
1200
|
-
});
|
|
1201
|
-
output(transformPaged(result, transformWorklog));
|
|
1202
|
-
});
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
1241
|
// src/utils/constants.ts
|
|
1206
1242
|
var DEFAULT_FIELDS = [
|
|
1207
1243
|
"summary",
|
|
@@ -1494,11 +1530,11 @@ Examples:
|
|
|
1494
1530
|
});
|
|
1495
1531
|
}
|
|
1496
1532
|
|
|
1497
|
-
// src/commands/issue/worklog.ts
|
|
1498
|
-
function
|
|
1499
|
-
parent.command("
|
|
1533
|
+
// src/commands/issue/worklog/add.ts
|
|
1534
|
+
function add2(parent) {
|
|
1535
|
+
parent.command("add <key>").description("Log time spent on an issue").requiredOption("--time <timeSpent>", "Time spent (e.g., '2h', '30m', '1d 4h')").option("--comment <text>", "Worklog comment").option("--started <datetime>", "Start time in ISO 8601 format").addHelpText(
|
|
1500
1536
|
"after",
|
|
1501
|
-
'\nExamples:\n jiradc issue worklog PROJ-123 --time 2h\n jiradc issue worklog PROJ-123 --time "1d 4h" --comment "Backend implementation"\n jiradc issue worklog PROJ-123 --time 3h --started "2026-03-19T09:00:00.000+0000"'
|
|
1537
|
+
'\nExamples:\n jiradc issue worklog add PROJ-123 --time 2h\n jiradc issue worklog add PROJ-123 --time "1d 4h" --comment "Backend implementation"\n jiradc issue worklog add PROJ-123 --time 3h --started "2026-03-19T09:00:00.000+0000"'
|
|
1502
1538
|
).action(async (key, opts) => {
|
|
1503
1539
|
const client = getClient();
|
|
1504
1540
|
const result = await client.issues.addWorklog({
|
|
@@ -1511,6 +1547,86 @@ function worklog(parent) {
|
|
|
1511
1547
|
});
|
|
1512
1548
|
}
|
|
1513
1549
|
|
|
1550
|
+
// src/commands/issue/worklog/delete.ts
|
|
1551
|
+
import { Option as Option4 } from "commander";
|
|
1552
|
+
var ADJUST_ESTIMATE = ["new", "leave", "manual", "auto"];
|
|
1553
|
+
function deleteWorklog(parent) {
|
|
1554
|
+
parent.command("delete <key>").description("Delete a worklog entry").requiredOption("--id <worklogId>", "Worklog ID to delete").addOption(new Option4("--adjust-estimate <mode>", "How to adjust the remaining estimate").choices(ADJUST_ESTIMATE)).option("--new-estimate <estimate>", 'New remaining estimate; required when --adjust-estimate is "new"').option("--increase-by <amount>", 'Amount to increase the estimate by; required when --adjust-estimate is "manual"').addHelpText(
|
|
1555
|
+
"after",
|
|
1556
|
+
"\nExamples:\n jiradc issue worklog delete PROJ-123 --id 12345\n jiradc issue worklog delete PROJ-123 --id 12345 --adjust-estimate leave\n jiradc issue worklog delete PROJ-123 --id 12345 --adjust-estimate new --new-estimate 2h"
|
|
1557
|
+
).action(
|
|
1558
|
+
async (key, opts) => {
|
|
1559
|
+
const client = getClient();
|
|
1560
|
+
await client.issues.deleteWorklog({
|
|
1561
|
+
issueKeyOrId: key,
|
|
1562
|
+
worklogId: opts.id,
|
|
1563
|
+
adjustEstimate: opts.adjustEstimate,
|
|
1564
|
+
newEstimate: opts.newEstimate,
|
|
1565
|
+
increaseBy: opts.increaseBy
|
|
1566
|
+
});
|
|
1567
|
+
output({ deleted: true, issueKey: key, worklogId: opts.id });
|
|
1568
|
+
}
|
|
1569
|
+
);
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
// src/commands/issue/worklog/edit.ts
|
|
1573
|
+
import { Option as Option5 } from "commander";
|
|
1574
|
+
var ADJUST_ESTIMATE2 = ["new", "leave", "auto"];
|
|
1575
|
+
function edit2(parent) {
|
|
1576
|
+
parent.command("edit <key>").description("Update an existing worklog entry").requiredOption("--id <worklogId>", "Worklog ID to edit").option("--time <timeSpent>", "Time spent (e.g., '2h', '30m', '1d 4h')").option("--comment <text>", "Worklog comment").option("--started <datetime>", "Start time in ISO 8601 format").addOption(new Option5("--adjust-estimate <mode>", "How to adjust the remaining estimate").choices(ADJUST_ESTIMATE2)).option("--new-estimate <estimate>", 'New remaining estimate; required when --adjust-estimate is "new"').addHelpText(
|
|
1577
|
+
"after",
|
|
1578
|
+
'\nExamples:\n jiradc issue worklog edit PROJ-123 --id 12345 --time "1h 30m"\n jiradc issue worklog edit PROJ-123 --id 12345 --comment "Revised note"\n jiradc issue worklog edit PROJ-123 --id 12345 --time 2h --adjust-estimate new --new-estimate 4h'
|
|
1579
|
+
).action(
|
|
1580
|
+
async (key, opts) => {
|
|
1581
|
+
const client = getClient();
|
|
1582
|
+
const result = await client.issues.updateWorklog({
|
|
1583
|
+
issueKeyOrId: key,
|
|
1584
|
+
worklogId: opts.id,
|
|
1585
|
+
timeSpent: opts.time,
|
|
1586
|
+
comment: opts.comment,
|
|
1587
|
+
started: opts.started,
|
|
1588
|
+
adjustEstimate: opts.adjustEstimate,
|
|
1589
|
+
newEstimate: opts.newEstimate
|
|
1590
|
+
});
|
|
1591
|
+
output(transformWorklog(result));
|
|
1592
|
+
}
|
|
1593
|
+
);
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
// src/commands/issue/worklog/list.ts
|
|
1597
|
+
function list4(parent) {
|
|
1598
|
+
parent.command("list <key>").description("Get worklogs for an issue").option("--start <number>", "Starting index for pagination", nonNegativeInt).option("--limit <number>", "Max results per page (1-1000)", intInRange(1, 1e3), 25).addHelpText(
|
|
1599
|
+
"after",
|
|
1600
|
+
"\nExamples:\n jiradc issue worklog list PROJ-123\n jiradc issue worklog list PROJ-123 --limit 10\n jiradc issue worklog list PROJ-123 --start 10 --limit 5"
|
|
1601
|
+
).action(async (key, opts) => {
|
|
1602
|
+
const client = getClient();
|
|
1603
|
+
const result = await client.issues.getWorklogs({
|
|
1604
|
+
issueKeyOrId: key,
|
|
1605
|
+
startAt: opts.start,
|
|
1606
|
+
maxResults: opts.limit
|
|
1607
|
+
});
|
|
1608
|
+
output(transformPaged(result, transformWorklog));
|
|
1609
|
+
});
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
// src/commands/issue/worklog/index.ts
|
|
1613
|
+
function registerWorklogCommands(parent) {
|
|
1614
|
+
const worklog = parent.command("worklog").description("Worklog operations").addHelpText(
|
|
1615
|
+
"after",
|
|
1616
|
+
`
|
|
1617
|
+
Examples:
|
|
1618
|
+
$ jiradc issue worklog add PROJ-123 --time 2h --comment "Backend work"
|
|
1619
|
+
$ jiradc issue worklog list PROJ-123 --limit 10
|
|
1620
|
+
$ jiradc issue worklog edit PROJ-123 --id 12345 --time "1h 30m"
|
|
1621
|
+
$ jiradc issue worklog delete PROJ-123 --id 12345
|
|
1622
|
+
`
|
|
1623
|
+
);
|
|
1624
|
+
add2(worklog);
|
|
1625
|
+
list4(worklog);
|
|
1626
|
+
edit2(worklog);
|
|
1627
|
+
deleteWorklog(worklog);
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1514
1630
|
// src/commands/issue/index.ts
|
|
1515
1631
|
function registerIssueCommands(program2) {
|
|
1516
1632
|
const issue = program2.command("issue").description("Issue operations").addHelpText(
|
|
@@ -1533,10 +1649,8 @@ Examples:
|
|
|
1533
1649
|
transition(issue);
|
|
1534
1650
|
transitions(issue);
|
|
1535
1651
|
assign(issue);
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
worklog(issue);
|
|
1539
|
-
getWorklog(issue);
|
|
1652
|
+
registerCommentCommands(issue);
|
|
1653
|
+
registerWorklogCommands(issue);
|
|
1540
1654
|
changelog(issue);
|
|
1541
1655
|
batchChangelog(issue);
|
|
1542
1656
|
link(issue);
|
|
@@ -1551,7 +1665,7 @@ Examples:
|
|
|
1551
1665
|
}
|
|
1552
1666
|
|
|
1553
1667
|
// src/commands/project/list.ts
|
|
1554
|
-
function
|
|
1668
|
+
function list5(parent) {
|
|
1555
1669
|
parent.command("list").description("List all projects").option("--expand <expand>", 'Expand options (e.g., "description,lead")').option("--include-archived", "Include archived projects (default: false)").addHelpText(
|
|
1556
1670
|
"after",
|
|
1557
1671
|
"\nExamples:\n jiradc project list\n jiradc project list --expand description,lead\n jiradc project list --include-archived"
|
|
@@ -1584,7 +1698,7 @@ Examples:
|
|
|
1584
1698
|
$ jiradc project versions PROJ
|
|
1585
1699
|
`
|
|
1586
1700
|
);
|
|
1587
|
-
|
|
1701
|
+
list5(project);
|
|
1588
1702
|
versions(project);
|
|
1589
1703
|
}
|
|
1590
1704
|
|
|
@@ -1606,10 +1720,20 @@ function create3(parent) {
|
|
|
1606
1720
|
});
|
|
1607
1721
|
}
|
|
1608
1722
|
|
|
1609
|
-
// src/commands/sprint/
|
|
1723
|
+
// src/commands/sprint/delete.ts
|
|
1610
1724
|
import { Argument as Argument2 } from "commander";
|
|
1725
|
+
function deleteSprint(parent) {
|
|
1726
|
+
parent.command("delete").description("Delete a sprint (returns its issues to the backlog)").addArgument(new Argument2("<id>", "Sprint ID").argParser(positiveInt)).addHelpText("after", "\nExamples:\n jiradc sprint delete 100").action(async (id) => {
|
|
1727
|
+
const client = getClient();
|
|
1728
|
+
await client.agile.deleteSprint({ sprintId: id });
|
|
1729
|
+
output({ deleted: true, sprintId: id });
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
// src/commands/sprint/issues.ts
|
|
1734
|
+
import { Argument as Argument3 } from "commander";
|
|
1611
1735
|
function issues2(parent) {
|
|
1612
|
-
parent.command("issues").description("Get issues in a sprint").addArgument(new
|
|
1736
|
+
parent.command("issues").description("Get issues in a sprint").addArgument(new Argument3("<id>", "Sprint ID").argParser(positiveInt)).option("--limit <number>", "Max results (1-50, Jira DC caps at 50)", intInRange(1, 50), 25).option("--start <number>", "Starting index for pagination", nonNegativeInt).option("--fields <fields>", "Comma-separated field names to return").option("--jql <jql>", "Additional JQL filter within the sprint").addHelpText(
|
|
1613
1737
|
"after",
|
|
1614
1738
|
'\nExamples:\n jiradc sprint issues 100\n jiradc sprint issues 100 --limit 20\n jiradc sprint issues 100 --jql "status = Done" --fields summary,status\n jiradc sprint issues 100 --start 50 --limit 25'
|
|
1615
1739
|
).action(async (id, opts) => {
|
|
@@ -1626,10 +1750,10 @@ function issues2(parent) {
|
|
|
1626
1750
|
}
|
|
1627
1751
|
|
|
1628
1752
|
// src/commands/sprint/list.ts
|
|
1629
|
-
import { Option as
|
|
1753
|
+
import { Option as Option6 } from "commander";
|
|
1630
1754
|
var SPRINT_STATES = ["future", "active", "closed"];
|
|
1631
|
-
function
|
|
1632
|
-
parent.command("list").description("List sprints for a board").requiredOption("--board <id>", "Board ID", positiveInt).addOption(new
|
|
1755
|
+
function list6(parent) {
|
|
1756
|
+
parent.command("list").description("List sprints for a board").requiredOption("--board <id>", "Board ID", positiveInt).addOption(new Option6("--state <state>", "Filter by sprint state").choices(SPRINT_STATES)).addHelpText(
|
|
1633
1757
|
"after",
|
|
1634
1758
|
"\nExamples:\n jiradc sprint list --board 42\n jiradc sprint list --board 42 --state active"
|
|
1635
1759
|
).action(async (opts) => {
|
|
@@ -1643,10 +1767,10 @@ function list5(parent) {
|
|
|
1643
1767
|
}
|
|
1644
1768
|
|
|
1645
1769
|
// src/commands/sprint/update.ts
|
|
1646
|
-
import { Argument as
|
|
1770
|
+
import { Argument as Argument4, Option as Option7 } from "commander";
|
|
1647
1771
|
var SPRINT_STATES2 = ["future", "active", "closed"];
|
|
1648
1772
|
function update3(parent) {
|
|
1649
|
-
parent.command("update").description("Update an existing sprint").addArgument(new
|
|
1773
|
+
parent.command("update").description("Update an existing sprint").addArgument(new Argument4("<id>", "Sprint ID").argParser(positiveInt)).option("--name <name>", "New sprint name").addOption(new Option7("--state <state>", "New sprint state").choices(SPRINT_STATES2)).option("--start-date <date>", "New start date in ISO 8601 format").option("--end-date <date>", "New end date in ISO 8601 format").option("--goal <goal>", "New sprint goal").addHelpText(
|
|
1650
1774
|
"after",
|
|
1651
1775
|
'\nExamples:\n jiradc sprint update 100 --name "Sprint 10 - Extended"\n jiradc sprint update 100 --state active\n jiradc sprint update 100 --end-date 2026-04-10 --goal "Updated goal"'
|
|
1652
1776
|
).action(
|
|
@@ -1677,10 +1801,11 @@ Examples:
|
|
|
1677
1801
|
$ jiradc sprint create --board 42 --name "Sprint 10" --start-date 2026-04-01 --end-date 2026-04-14
|
|
1678
1802
|
`
|
|
1679
1803
|
);
|
|
1680
|
-
|
|
1804
|
+
list6(sprint);
|
|
1681
1805
|
issues2(sprint);
|
|
1682
1806
|
create3(sprint);
|
|
1683
1807
|
update3(sprint);
|
|
1808
|
+
deleteSprint(sprint);
|
|
1684
1809
|
}
|
|
1685
1810
|
|
|
1686
1811
|
// src/commands/token/client.ts
|
|
@@ -1740,7 +1865,7 @@ Examples:
|
|
|
1740
1865
|
}
|
|
1741
1866
|
|
|
1742
1867
|
// src/commands/token/list.ts
|
|
1743
|
-
function
|
|
1868
|
+
function list7(parent) {
|
|
1744
1869
|
parent.command("list").description("List Personal Access Tokens owned by the authenticated user (secrets not included)").option("--basic-username <u>", "Override $JIRA_BASIC_USERNAME").option(
|
|
1745
1870
|
"--basic-password <p>",
|
|
1746
1871
|
"Override $JIRA_BASIC_PASSWORD (caution: visible in process table; prefer the env var)"
|
|
@@ -1784,7 +1909,7 @@ Auth:
|
|
|
1784
1909
|
`
|
|
1785
1910
|
);
|
|
1786
1911
|
create4(token);
|
|
1787
|
-
|
|
1912
|
+
list7(token);
|
|
1788
1913
|
revoke(token);
|
|
1789
1914
|
}
|
|
1790
1915
|
|
|
@@ -1853,7 +1978,7 @@ function readPackageVersion() {
|
|
|
1853
1978
|
}
|
|
1854
1979
|
var DIM = "\x1B[2m";
|
|
1855
1980
|
var RESET = "\x1B[0m";
|
|
1856
|
-
var program = new
|
|
1981
|
+
var program = new Command11();
|
|
1857
1982
|
program.name("jiradc").description("Jira Data Center CLI").version(readPackageVersion()).configureHelp({
|
|
1858
1983
|
styleTitle: (str) => styleText("bold", str),
|
|
1859
1984
|
styleUsage: (str) => styleText("dim", str),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jiradc-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20-g329927f.1",
|
|
4
4
|
"publish": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"commander": "^13.1.0",
|
|
15
|
-
"jira-data-center-client": "1.0.36"
|
|
15
|
+
"jira-data-center-client": "1.0.36-g329927f.1"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/node": "24.10.4",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"tsx": "^4.19.2",
|
|
23
23
|
"typescript": "^5.7.2",
|
|
24
24
|
"vitest": "^4.0.16",
|
|
25
|
-
"config-
|
|
26
|
-
"config-
|
|
25
|
+
"config-typescript": "0.0.0",
|
|
26
|
+
"config-eslint": "0.0.0"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">=22.0.0"
|