jiradc-cli 1.0.36 → 1.0.38
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 +281 -114
- package/dist/index.js +189 -80
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -227,6 +227,17 @@ function subEntityOption(cmd, entity, opts = {}) {
|
|
|
227
227
|
const description = `${entity.charAt(0).toUpperCase()}${entity.slice(1)} id`;
|
|
228
228
|
return defineOption(cmd, `--${entity}-id <id>`, description, numeric ? positiveInt : text, opts.mandatory);
|
|
229
229
|
}
|
|
230
|
+
function paginationOptions(cmd, opts = {}) {
|
|
231
|
+
const max = opts.maxLimit ?? 1e3;
|
|
232
|
+
const def = opts.defaultLimit ?? 25;
|
|
233
|
+
cmd.option("--limit <n>", `Max results per page (1-${max})`, intInRange(1, max), def);
|
|
234
|
+
if (opts.startIsToken) {
|
|
235
|
+
cmd.option("--start <indexOrToken>", "Pagination cursor: 0-based offset or opaque next-page token", text);
|
|
236
|
+
} else {
|
|
237
|
+
cmd.option("--start <index>", "Pagination offset (0-based)", nonNegativeInt);
|
|
238
|
+
}
|
|
239
|
+
return cmd;
|
|
240
|
+
}
|
|
230
241
|
function bodyOption(cmd, opts = {}) {
|
|
231
242
|
return textOrFileOption(cmd, "body", { description: "Prose body content", ...opts });
|
|
232
243
|
}
|
|
@@ -677,9 +688,6 @@ async function runCli(program, opts) {
|
|
|
677
688
|
import { styleText } from "util";
|
|
678
689
|
import { Command as Command17 } from "commander";
|
|
679
690
|
|
|
680
|
-
// src/commands/board/issues.ts
|
|
681
|
-
import { Argument } from "commander";
|
|
682
|
-
|
|
683
691
|
// src/utils/client.ts
|
|
684
692
|
import { JiraClient } from "jira-data-center-client";
|
|
685
693
|
function getClient() {
|
|
@@ -716,8 +724,12 @@ function transformPaged(response, fn) {
|
|
|
716
724
|
const mapped2 = response.values.map(fn);
|
|
717
725
|
return { startAt, maxResults, total, isLast: startAt + mapped2.length >= total, values: mapped2 };
|
|
718
726
|
}
|
|
719
|
-
|
|
720
|
-
|
|
727
|
+
if ("worklogs" in response) {
|
|
728
|
+
const mapped2 = response.worklogs.map(fn);
|
|
729
|
+
return { startAt, maxResults, total, isLast: startAt + mapped2.length >= total, worklogs: mapped2 };
|
|
730
|
+
}
|
|
731
|
+
const mapped = response.comments.map(fn);
|
|
732
|
+
return { startAt, maxResults, total, isLast: startAt + mapped.length >= total, comments: mapped };
|
|
721
733
|
}
|
|
722
734
|
|
|
723
735
|
// src/utils/transformers/user.ts
|
|
@@ -766,6 +778,31 @@ function transformProject(p) {
|
|
|
766
778
|
...lead ? { lead: transformUser(lead) } : {}
|
|
767
779
|
};
|
|
768
780
|
}
|
|
781
|
+
function transformProjectDetail(p) {
|
|
782
|
+
const {
|
|
783
|
+
self: _self,
|
|
784
|
+
avatarUrls: _avatarUrls,
|
|
785
|
+
expand: _expand,
|
|
786
|
+
// Roles arrive as a map of name to REST URL. Nothing in this CLI follows
|
|
787
|
+
// one, so the names alone would be a dead end for the caller.
|
|
788
|
+
roles: _roles,
|
|
789
|
+
lead,
|
|
790
|
+
issueTypes,
|
|
791
|
+
components,
|
|
792
|
+
versions: versions2,
|
|
793
|
+
...rest
|
|
794
|
+
} = p;
|
|
795
|
+
return {
|
|
796
|
+
...rest,
|
|
797
|
+
url: projectBrowseUrl(p.key),
|
|
798
|
+
...lead ? { lead: transformUser(lead) } : {},
|
|
799
|
+
...issueTypes ? { issueTypes: issueTypes.map((t) => t.name) } : {},
|
|
800
|
+
// Always present on a single-project read, so an absent array means empty
|
|
801
|
+
// rather than unknown.
|
|
802
|
+
components: { count: components?.length ?? 0, use: `jiradc component list --project ${p.key}` },
|
|
803
|
+
versions: { count: versions2?.length ?? 0, use: `jiradc project versions ${p.key}` }
|
|
804
|
+
};
|
|
805
|
+
}
|
|
769
806
|
|
|
770
807
|
// src/utils/transformers/component.ts
|
|
771
808
|
function componentBrowseUrl(projectKey) {
|
|
@@ -1222,7 +1259,19 @@ function transformFolderTree(root) {
|
|
|
1222
1259
|
return transformFolderNode(root);
|
|
1223
1260
|
}
|
|
1224
1261
|
|
|
1262
|
+
// src/commands/board/get.ts
|
|
1263
|
+
function get(parent) {
|
|
1264
|
+
const cmd = parent.command("get").description("Get a board by ID").argument("<id>", "Board ID", positiveInt);
|
|
1265
|
+
examples(cmd, ["42"]);
|
|
1266
|
+
cmd.action(async (id) => {
|
|
1267
|
+
const client = getClient();
|
|
1268
|
+
const result = await client.agile.getBoard(id);
|
|
1269
|
+
output(transformBoard(result));
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1225
1273
|
// src/commands/board/issues.ts
|
|
1274
|
+
import { Argument } from "commander";
|
|
1226
1275
|
function issues(parent) {
|
|
1227
1276
|
const cmd = parent.command("issues").description("Get issues for a board").addArgument(new Argument("<id>", "Board 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", text).option("--jql <jql>", "Additional JQL filter within the board", text);
|
|
1228
1277
|
examples(cmd, [
|
|
@@ -1265,8 +1314,9 @@ function list(parent) {
|
|
|
1265
1314
|
// src/commands/board/index.ts
|
|
1266
1315
|
function registerBoardCommands(program) {
|
|
1267
1316
|
const board = program.command("board").description("Board operations");
|
|
1268
|
-
examples(board, ["list", "list --type scrum --project PROJ", "issues 42 --limit 20"]);
|
|
1317
|
+
examples(board, ["list", "list --type scrum --project PROJ", "get 42", "issues 42 --limit 20"]);
|
|
1269
1318
|
list(board);
|
|
1319
|
+
get(board);
|
|
1270
1320
|
issues(board);
|
|
1271
1321
|
}
|
|
1272
1322
|
|
|
@@ -1279,7 +1329,7 @@ var ASSIGNEE_TYPES = [
|
|
|
1279
1329
|
"UNASSIGNED"
|
|
1280
1330
|
];
|
|
1281
1331
|
function create(parent) {
|
|
1282
|
-
const cmd = parent.command("create").description("Create a new component in a project").requiredOption("--project <key>", "Project key (e.g.,
|
|
1332
|
+
const cmd = parent.command("create").description("Create a new component in a project").requiredOption("--project <key>", "Project key (e.g., PROJ)", text).requiredOption("--name <name>", "Component name", text).option("--lead <username>", "Username of the component lead", text).addOption(new Option3("--assignee-type <type>", "Assignee strategy").choices(ASSIGNEE_TYPES));
|
|
1283
1333
|
textOrFileOption(cmd, "description", { description: "Component description" });
|
|
1284
1334
|
examples(cmd, [
|
|
1285
1335
|
"--project PROJ --name Backend",
|
|
@@ -1314,7 +1364,7 @@ function deleteComponent(parent) {
|
|
|
1314
1364
|
}
|
|
1315
1365
|
|
|
1316
1366
|
// src/commands/component/get.ts
|
|
1317
|
-
function
|
|
1367
|
+
function get2(parent) {
|
|
1318
1368
|
const cmd = parent.command("get").description("Get a component by ID").argument("<id>", "Component ID", positiveInt);
|
|
1319
1369
|
examples(cmd, ["11289"]);
|
|
1320
1370
|
cmd.action(async (id) => {
|
|
@@ -1337,7 +1387,7 @@ function issueCount(parent) {
|
|
|
1337
1387
|
|
|
1338
1388
|
// src/commands/component/list.ts
|
|
1339
1389
|
function list2(parent) {
|
|
1340
|
-
const cmd = parent.command("list").description("List all components for a project").requiredOption("--project <key>", "Project key (e.g.,
|
|
1390
|
+
const cmd = parent.command("list").description("List all components for a project").requiredOption("--project <key>", "Project key (e.g., PROJ)", text);
|
|
1341
1391
|
examples(cmd, ["--project PROJ"]);
|
|
1342
1392
|
cmd.action(async (opts) => {
|
|
1343
1393
|
const client = getClient();
|
|
@@ -1393,7 +1443,7 @@ function registerComponentCommands(program) {
|
|
|
1393
1443
|
"issue-count 11289"
|
|
1394
1444
|
]);
|
|
1395
1445
|
list2(component);
|
|
1396
|
-
|
|
1446
|
+
get2(component);
|
|
1397
1447
|
create(component);
|
|
1398
1448
|
update(component);
|
|
1399
1449
|
deleteComponent(component);
|
|
@@ -1402,7 +1452,7 @@ function registerComponentCommands(program) {
|
|
|
1402
1452
|
|
|
1403
1453
|
// src/commands/field/search.ts
|
|
1404
1454
|
function search(parent) {
|
|
1405
|
-
const cmd = parent.command("search").description("Search for fields by name or ID").argument("<keyword>", "Search keyword",
|
|
1455
|
+
const cmd = parent.command("search").description("Search for fields by name or ID").argument("<keyword>", "Search keyword", nonEmpty).option("--limit <number>", "Maximum number of results (1-1000)", intInRange(1, 1e3), 25);
|
|
1406
1456
|
examples(cmd, ["epic", "customfield_10100", "priority --limit 5"]);
|
|
1407
1457
|
cmd.action(async (keyword, opts) => {
|
|
1408
1458
|
const client = getClient();
|
|
@@ -1621,13 +1671,12 @@ function registerAttachmentCommands(parent) {
|
|
|
1621
1671
|
|
|
1622
1672
|
// src/commands/issue/batch-changelog.ts
|
|
1623
1673
|
function batchChangelog(parent) {
|
|
1624
|
-
const cmd = parent.command("batch-changelog").description("Get changelogs for multiple issues at once").argument("<keys>", "Comma-separated issue keys",
|
|
1674
|
+
const cmd = parent.command("batch-changelog").description("Get changelogs for multiple issues at once").argument("<keys>", "Comma-separated issue keys", keyList).option("--limit <number>", "Max changelog entries per issue (1-50, Jira DC caps at 50)", intInRange(1, 50), 25);
|
|
1625
1675
|
examples(cmd, ["PROJ-1,PROJ-2,PROJ-3", "PROJ-123,PROJ-124 --limit 10"]);
|
|
1626
1676
|
cmd.action(async (keys, opts) => {
|
|
1627
1677
|
const client = getClient();
|
|
1628
|
-
const keyList2 = keys.split(",").map((k) => k.trim());
|
|
1629
1678
|
const entries = await Promise.all(
|
|
1630
|
-
|
|
1679
|
+
keys.map(async (key) => {
|
|
1631
1680
|
try {
|
|
1632
1681
|
const data = await client.issues.getChangelog({ issueKeyOrId: key, maxResults: opts.limit });
|
|
1633
1682
|
return [key, data];
|
|
@@ -1794,6 +1843,37 @@ function deleteComment(parent) {
|
|
|
1794
1843
|
});
|
|
1795
1844
|
}
|
|
1796
1845
|
|
|
1846
|
+
// src/commands/issue/comment/get.ts
|
|
1847
|
+
function get3(parent) {
|
|
1848
|
+
const cmd = parent.command("get").description("Get a single comment on an issue").argument("<key>", "Issue key", issueKey);
|
|
1849
|
+
subEntityOption(cmd, "comment", { mandatory: true });
|
|
1850
|
+
examples(cmd, ["PROJ-123 --comment-id 12345"]);
|
|
1851
|
+
cmd.action(async (key, opts) => {
|
|
1852
|
+
const client = getClient();
|
|
1853
|
+
const result = await client.issues.getComment({
|
|
1854
|
+
issueKeyOrId: key,
|
|
1855
|
+
commentId: String(opts.commentId)
|
|
1856
|
+
});
|
|
1857
|
+
output(transformComment(result));
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
// src/commands/issue/comment/list.ts
|
|
1862
|
+
function list4(parent) {
|
|
1863
|
+
const cmd = parent.command("list").description("List comments on an issue").argument("<key>", "Issue key", issueKey);
|
|
1864
|
+
paginationOptions(cmd);
|
|
1865
|
+
examples(cmd, ["PROJ-123", "PROJ-123 --limit 10", "PROJ-123 --start 10 --limit 5"]);
|
|
1866
|
+
cmd.action(async (key, opts) => {
|
|
1867
|
+
const client = getClient();
|
|
1868
|
+
const result = await client.issues.getComments({
|
|
1869
|
+
issueKeyOrId: key,
|
|
1870
|
+
startAt: opts.start,
|
|
1871
|
+
maxResults: opts.limit
|
|
1872
|
+
});
|
|
1873
|
+
output(transformPaged(result, transformComment));
|
|
1874
|
+
});
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1797
1877
|
// src/commands/issue/comment/update.ts
|
|
1798
1878
|
function update2(parent) {
|
|
1799
1879
|
const cmd = parent.command("update").description("Update an existing comment").argument("<key>", "Issue key", issueKey);
|
|
@@ -1816,10 +1896,14 @@ function update2(parent) {
|
|
|
1816
1896
|
function registerCommentCommands(parent) {
|
|
1817
1897
|
const comment = parent.command("comment").description("Comment operations");
|
|
1818
1898
|
examples(comment, [
|
|
1899
|
+
"list PROJ-123",
|
|
1900
|
+
"get PROJ-123 --comment-id 12345",
|
|
1819
1901
|
'create PROJ-123 --body "Fixed in latest build"',
|
|
1820
1902
|
'update PROJ-123 --comment-id 12345 --body "Updated comment text"',
|
|
1821
1903
|
"delete PROJ-123 --comment-id 12345"
|
|
1822
1904
|
]);
|
|
1905
|
+
list4(comment);
|
|
1906
|
+
get3(comment);
|
|
1823
1907
|
create2(comment);
|
|
1824
1908
|
update2(comment);
|
|
1825
1909
|
deleteComment(comment);
|
|
@@ -2114,7 +2198,7 @@ async function selectFields(client, opts, defaults) {
|
|
|
2114
2198
|
}
|
|
2115
2199
|
|
|
2116
2200
|
// src/commands/issue/get.ts
|
|
2117
|
-
function
|
|
2201
|
+
function get4(parent) {
|
|
2118
2202
|
const cmd = parent.command("get").description("Get issue details").argument("<key>", "Issue key", issueKey).option("--fields <fields>", "Comma-separated fields to return, by name or id", text).option("--all-fields", "Return all fields instead of defaults").option("--expand <expand>", 'Expand options (e.g., "transitions", "changelog")', text);
|
|
2119
2203
|
examples(cmd, [
|
|
2120
2204
|
"PROJ-123",
|
|
@@ -2236,7 +2320,7 @@ async function fetchEveryPage(fetchPage, opts) {
|
|
|
2236
2320
|
// src/commands/issue/search.ts
|
|
2237
2321
|
var MAX_PAGE_SIZE = 50;
|
|
2238
2322
|
function search2(parent) {
|
|
2239
|
-
const cmd = parent.command("search").description("Search issues using JQL").argument("<jql>", "JQL query string",
|
|
2323
|
+
const cmd = parent.command("search").description("Search issues using JQL").argument("<jql>", "JQL query string", nonEmpty).option(
|
|
2240
2324
|
"--limit <number>",
|
|
2241
2325
|
`Max results (1-${MAX_PAGE_SIZE}, Jira DC caps at ${MAX_PAGE_SIZE})`,
|
|
2242
2326
|
intInRange(1, MAX_PAGE_SIZE),
|
|
@@ -2527,7 +2611,7 @@ function deleteWorklog(parent) {
|
|
|
2527
2611
|
}
|
|
2528
2612
|
|
|
2529
2613
|
// src/commands/issue/worklog/list.ts
|
|
2530
|
-
function
|
|
2614
|
+
function list5(parent) {
|
|
2531
2615
|
const cmd = parent.command("list").description("Get worklogs for an issue").argument("<key>", "Issue key", issueKey).option("--start <number>", "Starting index for pagination", nonNegativeInt).option("--limit <number>", "Max results per page (1-1000)", intInRange(1, 1e3), 25);
|
|
2532
2616
|
examples(cmd, ["PROJ-123", "PROJ-123 --limit 10", "PROJ-123 --start 10 --limit 5"]);
|
|
2533
2617
|
cmd.action(async (key, opts) => {
|
|
@@ -2582,7 +2666,7 @@ function registerWorklogCommands(parent) {
|
|
|
2582
2666
|
"delete PROJ-123 --worklog-id 12345"
|
|
2583
2667
|
]);
|
|
2584
2668
|
create4(worklog);
|
|
2585
|
-
|
|
2669
|
+
list5(worklog);
|
|
2586
2670
|
update4(worklog);
|
|
2587
2671
|
deleteWorklog(worklog);
|
|
2588
2672
|
}
|
|
@@ -2598,7 +2682,7 @@ function registerIssueCommands(program) {
|
|
|
2598
2682
|
"transition PROJ-123 --to 11",
|
|
2599
2683
|
"attachment list PROJ-123"
|
|
2600
2684
|
]);
|
|
2601
|
-
|
|
2685
|
+
get4(issue);
|
|
2602
2686
|
search2(issue);
|
|
2603
2687
|
create3(issue);
|
|
2604
2688
|
update3(issue);
|
|
@@ -2622,8 +2706,19 @@ function registerIssueCommands(program) {
|
|
|
2622
2706
|
devStatus(issue);
|
|
2623
2707
|
}
|
|
2624
2708
|
|
|
2709
|
+
// src/commands/project/get.ts
|
|
2710
|
+
function get5(parent) {
|
|
2711
|
+
const cmd = parent.command("get").description("Get a single project by key or ID").argument("<key>", "Project key or ID", nonEmpty);
|
|
2712
|
+
examples(cmd, ["PROJ", "10000"]);
|
|
2713
|
+
cmd.action(async (key) => {
|
|
2714
|
+
const client = getClient();
|
|
2715
|
+
const result = await client.projects.get({ projectKeyOrId: key });
|
|
2716
|
+
output(transformProjectDetail(result));
|
|
2717
|
+
});
|
|
2718
|
+
}
|
|
2719
|
+
|
|
2625
2720
|
// src/commands/project/list.ts
|
|
2626
|
-
function
|
|
2721
|
+
function list6(parent) {
|
|
2627
2722
|
const cmd = parent.command("list").description("List all projects").option("--expand <expand>", 'Expand options (e.g., "description,lead")', text).option("--include-archived", "Include archived projects (default: false)");
|
|
2628
2723
|
examples(cmd, ["", "--expand description,lead", "--include-archived"]);
|
|
2629
2724
|
cmd.action(async (opts) => {
|
|
@@ -2635,7 +2730,7 @@ function list5(parent) {
|
|
|
2635
2730
|
|
|
2636
2731
|
// src/commands/project/versions.ts
|
|
2637
2732
|
function versions(parent) {
|
|
2638
|
-
const cmd = parent.command("versions").description("Get all versions for a project").argument("<key>", "Project key",
|
|
2733
|
+
const cmd = parent.command("versions").description("Get all versions for a project").argument("<key>", "Project key", nonEmpty).option("--expand <expand>", "Expand options", text);
|
|
2639
2734
|
examples(cmd, ["PROJ", "PROJ --expand operations"]);
|
|
2640
2735
|
cmd.action(async (key, opts) => {
|
|
2641
2736
|
const client = getClient();
|
|
@@ -2647,8 +2742,9 @@ function versions(parent) {
|
|
|
2647
2742
|
// src/commands/project/index.ts
|
|
2648
2743
|
function registerProjectCommands(program) {
|
|
2649
2744
|
const project = program.command("project").description("Project operations");
|
|
2650
|
-
examples(project, ["list", "versions PROJ"]);
|
|
2651
|
-
|
|
2745
|
+
examples(project, ["list", "get PROJ", "versions PROJ"]);
|
|
2746
|
+
get5(project);
|
|
2747
|
+
list6(project);
|
|
2652
2748
|
versions(project);
|
|
2653
2749
|
}
|
|
2654
2750
|
|
|
@@ -2684,6 +2780,17 @@ function deleteSprint(parent) {
|
|
|
2684
2780
|
});
|
|
2685
2781
|
}
|
|
2686
2782
|
|
|
2783
|
+
// src/commands/sprint/get.ts
|
|
2784
|
+
function get6(parent) {
|
|
2785
|
+
const cmd = parent.command("get").description("Get a sprint by ID").argument("<id>", "Sprint ID", positiveInt);
|
|
2786
|
+
examples(cmd, ["123"]);
|
|
2787
|
+
cmd.action(async (id) => {
|
|
2788
|
+
const client = getClient();
|
|
2789
|
+
const result = await client.agile.getSprint(id);
|
|
2790
|
+
output(transformSprint(result));
|
|
2791
|
+
});
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2687
2794
|
// src/commands/sprint/issues.ts
|
|
2688
2795
|
import { Argument as Argument3 } from "commander";
|
|
2689
2796
|
function issues2(parent) {
|
|
@@ -2710,7 +2817,7 @@ function issues2(parent) {
|
|
|
2710
2817
|
// src/commands/sprint/list.ts
|
|
2711
2818
|
import { Option as Option8 } from "commander";
|
|
2712
2819
|
var SPRINT_STATES = ["future", "active", "closed"];
|
|
2713
|
-
function
|
|
2820
|
+
function list7(parent) {
|
|
2714
2821
|
const cmd = parent.command("list").description("List sprints for a board").requiredOption("--board <id>", "Board ID", positiveInt).addOption(new Option8("--state <state>", "Filter by sprint state").choices(SPRINT_STATES));
|
|
2715
2822
|
examples(cmd, ["--board 42", "--board 42 --state active"]);
|
|
2716
2823
|
cmd.action(async (opts) => {
|
|
@@ -2755,10 +2862,12 @@ function registerSprintCommands(program) {
|
|
|
2755
2862
|
examples(sprint, [
|
|
2756
2863
|
"list --board 42",
|
|
2757
2864
|
"list --board 42 --state active",
|
|
2865
|
+
"get 123",
|
|
2758
2866
|
"issues 123 --limit 20",
|
|
2759
2867
|
'create --board 42 --name "Sprint 10" --start-date 2026-04-01 --end-date 2026-04-14'
|
|
2760
2868
|
]);
|
|
2761
|
-
|
|
2869
|
+
list7(sprint);
|
|
2870
|
+
get6(sprint);
|
|
2762
2871
|
issues2(sprint);
|
|
2763
2872
|
create5(sprint);
|
|
2764
2873
|
update5(sprint);
|
|
@@ -2811,7 +2920,7 @@ function create6(parent) {
|
|
|
2811
2920
|
}
|
|
2812
2921
|
|
|
2813
2922
|
// src/commands/token/list.ts
|
|
2814
|
-
function
|
|
2923
|
+
function list8(parent) {
|
|
2815
2924
|
const cmd = parent.command("list").description("List Personal Access Tokens owned by the authenticated user (secrets not included)").option("--basic-username <u>", "Override $JIRA_BASIC_USERNAME", text).option(
|
|
2816
2925
|
"--basic-password <p>",
|
|
2817
2926
|
"Override $JIRA_BASIC_PASSWORD (caution: visible in process table; prefer the env var)",
|
|
@@ -2855,13 +2964,13 @@ function registerTokenCommands(program) {
|
|
|
2855
2964
|
"\nAuth:\n Requires JIRA_BASIC_USERNAME + JIRA_BASIC_PASSWORD\n (or --basic-username / --basic-password on any subcommand)."
|
|
2856
2965
|
);
|
|
2857
2966
|
create6(token);
|
|
2858
|
-
|
|
2967
|
+
list8(token);
|
|
2859
2968
|
revoke(token);
|
|
2860
2969
|
}
|
|
2861
2970
|
|
|
2862
2971
|
// src/commands/user/get.ts
|
|
2863
|
-
function
|
|
2864
|
-
const cmd = parent.command("get").description("Get a user profile by exact username or key").argument("<username>", "Username or user key",
|
|
2972
|
+
function get7(parent) {
|
|
2973
|
+
const cmd = parent.command("get").description("Get a user profile by exact username or key").argument("<username>", "Username or user key", nonEmpty).option("--by-key", "Treat the positional argument as a user key instead of a username");
|
|
2865
2974
|
examples(cmd, ["jsmith", "JIRAUSER10100 --by-key"]);
|
|
2866
2975
|
cmd.action(async (identifier, opts) => {
|
|
2867
2976
|
const client = getClient();
|
|
@@ -2883,7 +2992,7 @@ function me(parent) {
|
|
|
2883
2992
|
|
|
2884
2993
|
// src/commands/user/search.ts
|
|
2885
2994
|
function search3(parent) {
|
|
2886
|
-
const cmd = parent.command("search").description("Search users by partial username, display name or email").argument("<query>", "Search query",
|
|
2995
|
+
const cmd = parent.command("search").description("Search users by partial username, display name or email").argument("<query>", "Search query", nonEmpty).option("--limit <n>", "Maximum results (1-50)", intInRange(1, 50), 25).option("--start <n>", "Starting index (pagination offset)", nonNegativeInt, 0).option("--include-inactive", "Include inactive users in results", false);
|
|
2887
2996
|
examples(cmd, ["Smith", '"John Smith"', "jsmith@example.com --limit 5"]);
|
|
2888
2997
|
cmd.action(async (query, opts) => {
|
|
2889
2998
|
const client = getClient();
|
|
@@ -2903,7 +3012,7 @@ function registerUserCommands(program) {
|
|
|
2903
3012
|
const user = program.command("user").description("User operations");
|
|
2904
3013
|
examples(user, ["me", "get jsmith", "search Smith"]);
|
|
2905
3014
|
me(user);
|
|
2906
|
-
|
|
3015
|
+
get7(user);
|
|
2907
3016
|
search3(user);
|
|
2908
3017
|
}
|
|
2909
3018
|
|
|
@@ -2938,8 +3047,8 @@ function add(parent) {
|
|
|
2938
3047
|
const keys = new Set(opts.test ?? []);
|
|
2939
3048
|
if (opts.set) {
|
|
2940
3049
|
const lists = await Promise.all(opts.set.map((setKey) => client.testSets.listTests({ setKey })));
|
|
2941
|
-
for (const
|
|
2942
|
-
const tests = Array.isArray(
|
|
3050
|
+
for (const list21 of lists) {
|
|
3051
|
+
const tests = Array.isArray(list21) ? list21 : list21.tests ?? [];
|
|
2943
3052
|
for (const t of tests) {
|
|
2944
3053
|
if (t.key) keys.add(String(t.key));
|
|
2945
3054
|
}
|
|
@@ -2986,7 +3095,7 @@ function deleteXrayIssue(client, key) {
|
|
|
2986
3095
|
|
|
2987
3096
|
// src/commands/xray/execution/create.ts
|
|
2988
3097
|
function create7(parent) {
|
|
2989
|
-
const cmd = parent.command("create").description("Create a new Xray Test Execution issue").requiredOption("--project <key>", "Project key (e.g.
|
|
3098
|
+
const cmd = parent.command("create").description("Create a new Xray Test Execution issue").requiredOption("--project <key>", "Project key (e.g. PROJ)", text).requiredOption("--summary <text>", "Test Execution summary (title)", text);
|
|
2990
3099
|
textOrFileOption(cmd, "description", { description: "Test Execution description" });
|
|
2991
3100
|
examples(cmd, [
|
|
2992
3101
|
'--project PROJ --summary "Sprint 42 regression run"',
|
|
@@ -3017,7 +3126,7 @@ function deleteExecution(parent) {
|
|
|
3017
3126
|
}
|
|
3018
3127
|
|
|
3019
3128
|
// src/commands/xray/execution/list.ts
|
|
3020
|
-
function
|
|
3129
|
+
function list9(parent) {
|
|
3021
3130
|
const cmd = parent.command("list").description(
|
|
3022
3131
|
"List Test Executions that contain a given test (inverse view). For the tests inside an execution, use: xray test list --execution <key>."
|
|
3023
3132
|
).requiredOption("--test <key>", "Test issue key whose executions to list (e.g. PROJ-584)", issueKey);
|
|
@@ -3068,7 +3177,7 @@ function registerExecutionCommands(xray) {
|
|
|
3068
3177
|
deleteExecution(execution2);
|
|
3069
3178
|
add(execution2);
|
|
3070
3179
|
remove(execution2);
|
|
3071
|
-
|
|
3180
|
+
list9(execution2);
|
|
3072
3181
|
}
|
|
3073
3182
|
|
|
3074
3183
|
// src/commands/xray/export/feature.ts
|
|
@@ -3096,7 +3205,7 @@ function registerExportCommands(xray) {
|
|
|
3096
3205
|
}
|
|
3097
3206
|
|
|
3098
3207
|
// src/commands/xray/field/list.ts
|
|
3099
|
-
function
|
|
3208
|
+
function list10(parent) {
|
|
3100
3209
|
const cmd = parent.command("list").description("List Xray custom fields available on this instance");
|
|
3101
3210
|
examples(cmd, [""]);
|
|
3102
3211
|
cmd.action(async () => {
|
|
@@ -3109,12 +3218,12 @@ function list9(parent) {
|
|
|
3109
3218
|
function registerFieldCommands2(xray) {
|
|
3110
3219
|
const field = xray.command("field").description("Xray field discovery");
|
|
3111
3220
|
examples(field, ["list"]);
|
|
3112
|
-
|
|
3221
|
+
list10(field);
|
|
3113
3222
|
}
|
|
3114
3223
|
|
|
3115
3224
|
// src/commands/xray/folder/add.ts
|
|
3116
3225
|
function add2(parent) {
|
|
3117
|
-
const cmd = parent.command("add").description("Add tests to a folder in the test repository").argument("<folderId>", "Folder id (from folder list)", positiveInt).requiredOption("--project <key>", "Project key (e.g.
|
|
3226
|
+
const cmd = parent.command("add").description("Add tests to a folder in the test repository").argument("<folderId>", "Folder id (from folder list)", positiveInt).requiredOption("--project <key>", "Project key (e.g. PROJ)", text).requiredOption("--test <keys>", "Comma-separated test issue keys to add (e.g. PROJ-1,PROJ-2)", keyList);
|
|
3118
3227
|
examples(cmd, ["818 --project PROJ --test PROJ-1", "818 --project PROJ --test PROJ-1,PROJ-2,PROJ-3"]);
|
|
3119
3228
|
cmd.action(async (folderId, opts) => {
|
|
3120
3229
|
const client = getClient();
|
|
@@ -3129,7 +3238,7 @@ function add2(parent) {
|
|
|
3129
3238
|
|
|
3130
3239
|
// src/commands/xray/folder/create.ts
|
|
3131
3240
|
function create8(parent) {
|
|
3132
|
-
const cmd = parent.command("create").description("Create a new folder in the test repository").requiredOption("--project <key>", "Project key (e.g.
|
|
3241
|
+
const cmd = parent.command("create").description("Create a new folder in the test repository").requiredOption("--project <key>", "Project key (e.g. PROJ)", text).option("--parent-id <id>", "Parent folder id (-1 = root)", integer, -1).requiredOption("--name <text>", "Folder name", text);
|
|
3133
3242
|
examples(cmd, [
|
|
3134
3243
|
"--project PROJ --name Smoke",
|
|
3135
3244
|
'--project PROJ --parent-id -1 --name "Regression Suite"',
|
|
@@ -3148,7 +3257,7 @@ function create8(parent) {
|
|
|
3148
3257
|
|
|
3149
3258
|
// src/commands/xray/folder/delete.ts
|
|
3150
3259
|
function deleteFolder(parent) {
|
|
3151
|
-
const cmd = parent.command("delete").description("Delete a folder from the test repository").argument("<folderId>", "Folder id to delete (from folder list)", positiveInt).requiredOption("--project <key>", "Project key (e.g.
|
|
3260
|
+
const cmd = parent.command("delete").description("Delete a folder from the test repository").argument("<folderId>", "Folder id to delete (from folder list)", positiveInt).requiredOption("--project <key>", "Project key (e.g. PROJ)", text);
|
|
3152
3261
|
examples(cmd, ["818 --project PROJ", "42 --project PROJ"]);
|
|
3153
3262
|
cmd.action(async (folderId, opts) => {
|
|
3154
3263
|
const client = getClient();
|
|
@@ -3158,8 +3267,8 @@ function deleteFolder(parent) {
|
|
|
3158
3267
|
}
|
|
3159
3268
|
|
|
3160
3269
|
// src/commands/xray/folder/list.ts
|
|
3161
|
-
function
|
|
3162
|
-
const cmd = parent.command("list").description("List the test repository folder tree for a project").requiredOption("--project <key>", "Project key (e.g.
|
|
3270
|
+
function list11(parent) {
|
|
3271
|
+
const cmd = parent.command("list").description("List the test repository folder tree for a project").requiredOption("--project <key>", "Project key (e.g. PROJ)", text);
|
|
3163
3272
|
examples(cmd, ["--project PROJ", "--project PROJ"]);
|
|
3164
3273
|
cmd.action(async (opts) => {
|
|
3165
3274
|
const client = getClient();
|
|
@@ -3170,7 +3279,7 @@ function list10(parent) {
|
|
|
3170
3279
|
|
|
3171
3280
|
// src/commands/xray/folder/remove.ts
|
|
3172
3281
|
function remove2(parent) {
|
|
3173
|
-
const cmd = parent.command("remove").description("Remove tests from a folder in the test repository").argument("<folderId>", "Folder id (from folder list)", positiveInt).requiredOption("--project <key>", "Project key (e.g.
|
|
3282
|
+
const cmd = parent.command("remove").description("Remove tests from a folder in the test repository").argument("<folderId>", "Folder id (from folder list)", positiveInt).requiredOption("--project <key>", "Project key (e.g. PROJ)", text).requiredOption("--test <keys>", "Comma-separated test issue keys to remove (e.g. PROJ-1,PROJ-2)", keyList);
|
|
3174
3283
|
examples(cmd, ["818 --project PROJ --test PROJ-1", "818 --project PROJ --test PROJ-1,PROJ-2"]);
|
|
3175
3284
|
cmd.action(async (folderId, opts) => {
|
|
3176
3285
|
const client = getClient();
|
|
@@ -3185,7 +3294,7 @@ function remove2(parent) {
|
|
|
3185
3294
|
|
|
3186
3295
|
// src/commands/xray/folder/update.ts
|
|
3187
3296
|
function update7(parent) {
|
|
3188
|
-
const cmd = parent.command("update").description("Rename or reorder a folder in the test repository").argument("<folderId>", "Folder id (from folder list)", positiveInt).requiredOption("--project <key>", "Project key (e.g.
|
|
3297
|
+
const cmd = parent.command("update").description("Rename or reorder a folder in the test repository").argument("<folderId>", "Folder id (from folder list)", positiveInt).requiredOption("--project <key>", "Project key (e.g. PROJ)", text).option("--name <text>", "New folder name", text).option("--rank <id>", "New folder rank/position", positiveInt);
|
|
3189
3298
|
examples(cmd, [
|
|
3190
3299
|
'818 --project PROJ --name "New Name"',
|
|
3191
3300
|
"818 --project PROJ --rank 2",
|
|
@@ -3212,7 +3321,7 @@ function registerFolderCommands(xray) {
|
|
|
3212
3321
|
"Xray Test Repository folder management (rename/reorder within parent only \u2014 cross-parent moves are UI-only, not supported by the API). To list tests in a folder use: xray test list --folder <id> --project <key>"
|
|
3213
3322
|
);
|
|
3214
3323
|
examples(folder, ["list --project PROJ", "create --project PROJ --parent-id -1 --name Smoke"]);
|
|
3215
|
-
|
|
3324
|
+
list11(folder);
|
|
3216
3325
|
create8(folder);
|
|
3217
3326
|
update7(folder);
|
|
3218
3327
|
deleteFolder(folder);
|
|
@@ -3230,7 +3339,7 @@ function execution(parent) {
|
|
|
3230
3339
|
const cmd = parent.command("execution").description("Import test execution results into Xray").requiredOption("--file <path>", "Path to the result file", filePath).addOption(
|
|
3231
3340
|
new Option10(
|
|
3232
3341
|
"--format <format>",
|
|
3233
|
-
"Result format. xray/cucumber/behave: JSON body, no --project/--execution required. junit/testng/nunit/xunit/robot: XML body, requires --project
|
|
3342
|
+
"Result format. xray/cucumber/behave: JSON body, no --project/--execution required. junit/testng/nunit/xunit/robot: XML body, requires either --project or --execution."
|
|
3234
3343
|
).choices(FORMATS).makeOptionMandatory()
|
|
3235
3344
|
).option(
|
|
3236
3345
|
"--project <text>",
|
|
@@ -3320,7 +3429,7 @@ function add3(parent) {
|
|
|
3320
3429
|
|
|
3321
3430
|
// src/commands/xray/plan/create.ts
|
|
3322
3431
|
function create9(parent) {
|
|
3323
|
-
const cmd = parent.command("create").description("Create a new Xray Test Plan issue").requiredOption("--project <key>", "Project key (e.g.
|
|
3432
|
+
const cmd = parent.command("create").description("Create a new Xray Test Plan issue").requiredOption("--project <key>", "Project key (e.g. PROJ)", text).requiredOption("--summary <text>", "Test Plan summary (title)", text);
|
|
3324
3433
|
textOrFileOption(cmd, "description", { description: "Test Plan description" });
|
|
3325
3434
|
examples(cmd, [
|
|
3326
3435
|
'--project PROJ --summary "Q3 regression plan"',
|
|
@@ -3351,7 +3460,7 @@ function deletePlan(parent) {
|
|
|
3351
3460
|
}
|
|
3352
3461
|
|
|
3353
3462
|
// src/commands/xray/plan/list.ts
|
|
3354
|
-
function
|
|
3463
|
+
function list12(parent) {
|
|
3355
3464
|
const cmd = parent.command("list").description(
|
|
3356
3465
|
"List Test Plans that contain a given test (inverse view). For the tests inside a plan, use: xray test list --plan <key>. For executions in a plan, use: xray execution list --plan <key>."
|
|
3357
3466
|
).requiredOption("--test <key>", "Test issue key whose plans to list (e.g. PROJ-574)", issueKey);
|
|
@@ -3411,7 +3520,7 @@ function registerPlanCommands(xray) {
|
|
|
3411
3520
|
deletePlan(plan);
|
|
3412
3521
|
add3(plan);
|
|
3413
3522
|
remove3(plan);
|
|
3414
|
-
|
|
3523
|
+
list12(plan);
|
|
3415
3524
|
}
|
|
3416
3525
|
|
|
3417
3526
|
// src/commands/xray/precondition/add.ts
|
|
@@ -3529,16 +3638,16 @@ function buildPreconditionCustomFields(map, opts) {
|
|
|
3529
3638
|
// src/commands/xray/precondition/create.ts
|
|
3530
3639
|
function create10(parent) {
|
|
3531
3640
|
const cmd = parent.command("create").description(
|
|
3532
|
-
"Create a new Xray Pre-Condition issue. Note: the Pre-Condition issue type is only available in projects
|
|
3533
|
-
).requiredOption("--project <key>", "Project key (e.g.
|
|
3641
|
+
"Create a new Xray Pre-Condition issue. Note: the Pre-Condition issue type is only available in projects configured for it; it may not be on your project scheme."
|
|
3642
|
+
).requiredOption("--project <key>", "Project key (e.g. PROJ)", text).requiredOption("--summary <text>", "Pre-Condition summary (title)", text).addOption(
|
|
3534
3643
|
new Option11("--type <type>", "Pre-Condition type").choices(["manual", "generic", "cucumber"]).default("manual")
|
|
3535
3644
|
);
|
|
3536
3645
|
textOrFileOption(cmd, "condition", { description: "Pre-condition body / definition text" });
|
|
3537
3646
|
textOrFileOption(cmd, "description", { description: "Pre-Condition issue description" });
|
|
3538
3647
|
examples(cmd, [
|
|
3539
|
-
'--project
|
|
3540
|
-
'--project
|
|
3541
|
-
'--project
|
|
3648
|
+
'--project PROJ --summary "User is logged in"',
|
|
3649
|
+
'--project PROJ --summary "API key valid" --type generic --condition "apiKey != null"',
|
|
3650
|
+
'--project PROJ --summary "Auth scenario" --type cucumber --condition "Given the user is authenticated"'
|
|
3542
3651
|
]);
|
|
3543
3652
|
cmd.action(
|
|
3544
3653
|
async (opts) => {
|
|
@@ -3578,7 +3687,7 @@ function deletePrecondition(parent) {
|
|
|
3578
3687
|
}
|
|
3579
3688
|
|
|
3580
3689
|
// src/commands/xray/precondition/list.ts
|
|
3581
|
-
function
|
|
3690
|
+
function list13(parent) {
|
|
3582
3691
|
const cmd = parent.command("list").description(
|
|
3583
3692
|
"List Pre-Conditions that apply to a given test (inverse view). For the forward view (tests covered by a precondition), use: xray precondition add/remove."
|
|
3584
3693
|
).requiredOption("--test <key>", "Test issue key whose pre-conditions to list (e.g. PROJ-584)", issueKey);
|
|
@@ -3648,7 +3757,7 @@ function registerPreconditionCommands(xray) {
|
|
|
3648
3757
|
"Xray Pre-Condition issue management (CRUD, membership). Note: Pre-Condition issue type is only available in projects where it is configured (not your project). To list tests covered by a precondition, use: xray test list --precondition <key>."
|
|
3649
3758
|
);
|
|
3650
3759
|
examples(precondition, [
|
|
3651
|
-
'create --project
|
|
3760
|
+
'create --project PROJ --summary "User is logged in"',
|
|
3652
3761
|
"add PROJ-50 --test PROJ-1,PROJ-2",
|
|
3653
3762
|
"list --test PROJ-584"
|
|
3654
3763
|
]);
|
|
@@ -3657,7 +3766,7 @@ function registerPreconditionCommands(xray) {
|
|
|
3657
3766
|
deletePrecondition(precondition);
|
|
3658
3767
|
add4(precondition);
|
|
3659
3768
|
remove4(precondition);
|
|
3660
|
-
|
|
3769
|
+
list13(precondition);
|
|
3661
3770
|
}
|
|
3662
3771
|
|
|
3663
3772
|
// src/utils/xray/run-id.ts
|
|
@@ -3771,7 +3880,7 @@ function deleteEvidence(parent) {
|
|
|
3771
3880
|
}
|
|
3772
3881
|
|
|
3773
3882
|
// src/commands/xray/run/evidence/list.ts
|
|
3774
|
-
function
|
|
3883
|
+
function list14(parent) {
|
|
3775
3884
|
const cmd = parent.command("list").description("List evidence (attachments) on a test run").argument("[runId]", "Test run id (from run list)", positiveInt).option("--execution <key>", "Test execution issue key (used with --test to resolve run id)", issueKey).option("--test <key>", "Test issue key (used with --execution to resolve run id)", issueKey);
|
|
3776
3885
|
examples(cmd, ["42", "--execution PROJ-1 --test PROJ-2"]);
|
|
3777
3886
|
cmd.action(async (runId, opts) => {
|
|
@@ -3791,12 +3900,12 @@ function registerEvidenceCommands(run) {
|
|
|
3791
3900
|
"delete 42 --evidence-id 7"
|
|
3792
3901
|
]);
|
|
3793
3902
|
add6(evidence);
|
|
3794
|
-
|
|
3903
|
+
list14(evidence);
|
|
3795
3904
|
deleteEvidence(evidence);
|
|
3796
3905
|
}
|
|
3797
3906
|
|
|
3798
3907
|
// src/commands/xray/run/field/get.ts
|
|
3799
|
-
function
|
|
3908
|
+
function get8(parent) {
|
|
3800
3909
|
const cmd = parent.command("get").description("Get a custom field value on a test run").argument("[runId]", "Test run id (from run list)", positiveInt).requiredOption("--field-id <id>", "Custom field id (from xray field list)", text).option("--execution <key>", "Test execution issue key (used with --test to resolve run id)", issueKey).option("--test <key>", "Test issue key (used with --execution to resolve run id)", issueKey);
|
|
3801
3910
|
examples(cmd, ["42 --field-id customfield_10100", "--execution PROJ-1 --test PROJ-2 --field-id customfield_10100"]);
|
|
3802
3911
|
cmd.action(async (runId, opts) => {
|
|
@@ -3828,12 +3937,12 @@ function set(parent) {
|
|
|
3828
3937
|
function registerRunFieldCommands(run) {
|
|
3829
3938
|
const field = run.command("field").description("Get or set Xray custom field values on a test run");
|
|
3830
3939
|
examples(field, ["get 42 --field-id customfield_10100", 'set 42 --field-id customfield_10100 --value "approved"']);
|
|
3831
|
-
|
|
3940
|
+
get8(field);
|
|
3832
3941
|
set(field);
|
|
3833
3942
|
}
|
|
3834
3943
|
|
|
3835
3944
|
// src/commands/xray/run/get.ts
|
|
3836
|
-
function
|
|
3945
|
+
function get9(parent) {
|
|
3837
3946
|
const cmd = parent.command("get").description("Get a test run by id or by execution + test key").argument("[runId]", "Test run id (from run list)", positiveInt).option("--execution <key>", "Test execution issue key (used with --test to resolve run id)", issueKey).option("--test <key>", "Test issue key (used with --execution to resolve run id)", issueKey);
|
|
3838
3947
|
examples(cmd, ["42", "--execution PROJ-1 --test PROJ-2"]);
|
|
3839
3948
|
cmd.action(async (runId, opts) => {
|
|
@@ -3845,7 +3954,7 @@ function get5(parent) {
|
|
|
3845
3954
|
}
|
|
3846
3955
|
|
|
3847
3956
|
// src/commands/xray/run/list.ts
|
|
3848
|
-
function
|
|
3957
|
+
function list15(parent) {
|
|
3849
3958
|
const cmd = parent.command("list").description("List test runs for a test execution (CLI-side slice with --limit/--start)").requiredOption("--execution <key>", "Test execution issue key", issueKey).option("--limit <number>", "Max results to return (1-200)", intInRange(1, 200), 50).option("--start <number>", "Starting index for pagination", nonNegativeInt);
|
|
3850
3959
|
examples(cmd, ["--execution PROJ-1", "--execution PROJ-1 --limit 10", "--execution PROJ-1 --limit 10 --start 10"]);
|
|
3851
3960
|
cmd.action(async (opts) => {
|
|
@@ -3858,7 +3967,7 @@ function list14(parent) {
|
|
|
3858
3967
|
}
|
|
3859
3968
|
|
|
3860
3969
|
// src/commands/xray/run/step/list.ts
|
|
3861
|
-
function
|
|
3970
|
+
function list16(parent) {
|
|
3862
3971
|
const cmd = parent.command("list").description("List step results for a test run").argument("[runId]", "Test run id (from run list)", positiveInt).option("--execution <key>", "Test execution issue key (used with --test to resolve run id)", issueKey).option("--test <key>", "Test issue key (used with --execution to resolve run id)", issueKey);
|
|
3863
3972
|
examples(cmd, ["42", "--execution PROJ-1 --test PROJ-2"]);
|
|
3864
3973
|
cmd.action(async (runId, opts) => {
|
|
@@ -3905,7 +4014,7 @@ function update10(parent) {
|
|
|
3905
4014
|
function registerRunStepCommands(run) {
|
|
3906
4015
|
const step = run.command("step").description("Manage step results within a test run. See also: xray step for test step definitions.");
|
|
3907
4016
|
examples(step, ["list --execution PROJ-1 --test PROJ-2", "update 42 --step-id 1 --status PASS"]);
|
|
3908
|
-
|
|
4017
|
+
list16(step);
|
|
3909
4018
|
update10(step);
|
|
3910
4019
|
}
|
|
3911
4020
|
|
|
@@ -3951,8 +4060,8 @@ function registerRunCommands(xray) {
|
|
|
3951
4060
|
"step list --execution PROJ-1 --test PROJ-2",
|
|
3952
4061
|
"field get 42 --field-id customfield_10100"
|
|
3953
4062
|
]);
|
|
3954
|
-
|
|
3955
|
-
|
|
4063
|
+
get9(run);
|
|
4064
|
+
list15(run);
|
|
3956
4065
|
update11(run);
|
|
3957
4066
|
registerDefectCommands(run);
|
|
3958
4067
|
registerEvidenceCommands(run);
|
|
@@ -3961,7 +4070,7 @@ function registerRunCommands(xray) {
|
|
|
3961
4070
|
}
|
|
3962
4071
|
|
|
3963
4072
|
// src/commands/xray/status/list.ts
|
|
3964
|
-
function
|
|
4073
|
+
function list17(parent) {
|
|
3965
4074
|
const cmd = parent.command("list").description("List configured Xray test (run) statuses").option("--step", "List test-step statuses instead of run statuses");
|
|
3966
4075
|
examples(cmd, ["", ["--step", "step statuses"]]);
|
|
3967
4076
|
cmd.action(async (opts) => {
|
|
@@ -3975,7 +4084,7 @@ function list16(parent) {
|
|
|
3975
4084
|
function registerStatusCommands(xray) {
|
|
3976
4085
|
const status = xray.command("status").description("Xray status discovery");
|
|
3977
4086
|
examples(status, ["list", ["list --step", "step statuses"]]);
|
|
3978
|
-
|
|
4087
|
+
list17(status);
|
|
3979
4088
|
}
|
|
3980
4089
|
|
|
3981
4090
|
// src/commands/xray/step/add.ts
|
|
@@ -4012,7 +4121,7 @@ function deleteStep(parent) {
|
|
|
4012
4121
|
}
|
|
4013
4122
|
|
|
4014
4123
|
// src/commands/xray/step/list.ts
|
|
4015
|
-
function
|
|
4124
|
+
function list18(parent) {
|
|
4016
4125
|
const cmd = parent.command("list").description("List manual test steps for a Test issue").requiredOption("--test <key>", "Test issue key (e.g. PROJ-584)", issueKey);
|
|
4017
4126
|
examples(cmd, ["--test PROJ-584"]);
|
|
4018
4127
|
cmd.action(async (opts) => {
|
|
@@ -4055,7 +4164,7 @@ function registerStepCommands(xray) {
|
|
|
4055
4164
|
"Manage manual test steps for a Test issue (scope: --test). Steps are ordered by insertion; use step list to see current ids."
|
|
4056
4165
|
);
|
|
4057
4166
|
examples(step, ['add --test PROJ-584 --action "Open login" --result "Form shows"', "list --test PROJ-584"]);
|
|
4058
|
-
|
|
4167
|
+
list18(step);
|
|
4059
4168
|
add7(step);
|
|
4060
4169
|
update12(step);
|
|
4061
4170
|
deleteStep(step);
|
|
@@ -4068,7 +4177,7 @@ var stepsSchema = z5.array(
|
|
|
4068
4177
|
z5.object({ action: z5.string(), data: z5.string().optional(), result: z5.string().optional() })
|
|
4069
4178
|
);
|
|
4070
4179
|
function create11(parent) {
|
|
4071
|
-
const cmd = parent.command("create").description("Create a new Xray Test issue").requiredOption("--project <key>", "Project key (e.g.
|
|
4180
|
+
const cmd = parent.command("create").description("Create a new Xray Test issue").requiredOption("--project <key>", "Project key (e.g. PROJ)", text).requiredOption("--summary <text>", "Test summary (title)", text).addOption(
|
|
4072
4181
|
new Option13("--type <type>", "Test type (when cucumber: also pass --gherkin; when generic: --definition)").choices(["manual", "cucumber", "generic"]).default("manual")
|
|
4073
4182
|
).addOption(
|
|
4074
4183
|
new Option13("--cucumber-type <cucumberType>", "Cucumber scenario type (required when --type cucumber)").choices([
|
|
@@ -4156,7 +4265,7 @@ function deleteTest(parent) {
|
|
|
4156
4265
|
}
|
|
4157
4266
|
|
|
4158
4267
|
// src/commands/xray/test/get.ts
|
|
4159
|
-
function
|
|
4268
|
+
function get10(parent) {
|
|
4160
4269
|
const cmd = parent.command("get").description("Get one or more Xray test issues by key").argument("<testKey...>", "One or more test issue keys (e.g. PROJ-584)", listOf(issueKey));
|
|
4161
4270
|
examples(cmd, ["PROJ-584", "PROJ-584 PROJ-585"]);
|
|
4162
4271
|
cmd.action(async (testKeys) => {
|
|
@@ -4167,7 +4276,7 @@ function get6(parent) {
|
|
|
4167
4276
|
}
|
|
4168
4277
|
|
|
4169
4278
|
// src/commands/xray/test/list.ts
|
|
4170
|
-
function
|
|
4279
|
+
function list19(parent) {
|
|
4171
4280
|
const cmd = parent.command("list").description(
|
|
4172
4281
|
"List Xray Test issues by scope: all tests in a project, or tests belonging to a set, plan, execution, precondition, or folder. Note: use `jiradc issue search` for richer JQL when scoping by project."
|
|
4173
4282
|
).option("--project <text>", "Project key \u2014 list all tests in the project (or companion to --folder)", text).option("--set <key>", "Test Set issue key \u2014 list tests in this set", issueKey).option("--plan <key>", "Test Plan issue key \u2014 list tests in this plan", issueKey).option("--execution <key>", "Test Execution issue key \u2014 list tests in this execution", issueKey).option("--precondition <key>", "Precondition issue key \u2014 list tests with this precondition", issueKey).option("--folder <id>", "Folder id \u2014 list tests in this folder (requires --project)", positiveInt).option("--limit <number>", "Max results (1-50, applies to --project scope)", intInRange(1, 50), 25).option("--start <number>", "Starting index for pagination (applies to --project scope)", nonNegativeInt);
|
|
@@ -4309,11 +4418,11 @@ function update13(parent) {
|
|
|
4309
4418
|
function registerTestCommands(xray) {
|
|
4310
4419
|
const test = xray.command("test").description("Xray Test issue management (CRUD)");
|
|
4311
4420
|
examples(test, ["get PROJ-584", 'create --project PROJ --summary "Login" --type manual']);
|
|
4312
|
-
|
|
4421
|
+
get10(test);
|
|
4313
4422
|
create11(test);
|
|
4314
4423
|
update13(test);
|
|
4315
4424
|
deleteTest(test);
|
|
4316
|
-
|
|
4425
|
+
list19(test);
|
|
4317
4426
|
}
|
|
4318
4427
|
|
|
4319
4428
|
// src/commands/xray/testset/add.ts
|
|
@@ -4329,7 +4438,7 @@ function add8(parent) {
|
|
|
4329
4438
|
|
|
4330
4439
|
// src/commands/xray/testset/create.ts
|
|
4331
4440
|
function create12(parent) {
|
|
4332
|
-
const cmd = parent.command("create").description("Create a new Xray Test Set issue").requiredOption("--project <key>", "Project key (e.g.
|
|
4441
|
+
const cmd = parent.command("create").description("Create a new Xray Test Set issue").requiredOption("--project <key>", "Project key (e.g. PROJ)", text).requiredOption("--summary <text>", "Test Set summary (title)", text);
|
|
4333
4442
|
textOrFileOption(cmd, "description", { description: "Test Set description" });
|
|
4334
4443
|
examples(cmd, [
|
|
4335
4444
|
'--project PROJ --summary "Smoke Test Set"',
|
|
@@ -4360,7 +4469,7 @@ function deleteTestset(parent) {
|
|
|
4360
4469
|
}
|
|
4361
4470
|
|
|
4362
4471
|
// src/commands/xray/testset/list.ts
|
|
4363
|
-
function
|
|
4472
|
+
function list20(parent) {
|
|
4364
4473
|
const cmd = parent.command("list").description(
|
|
4365
4474
|
"List Test Sets that contain a given test (inverse view). For the forward view (tests inside a set), use: xray test list --set <key>"
|
|
4366
4475
|
).requiredOption("--test <key>", "Test issue key whose sets to list (e.g. PROJ-584)", issueKey);
|
|
@@ -4407,7 +4516,7 @@ function registerTestsetCommands(xray) {
|
|
|
4407
4516
|
deleteTestset(testset);
|
|
4408
4517
|
add8(testset);
|
|
4409
4518
|
remove6(testset);
|
|
4410
|
-
|
|
4519
|
+
list20(testset);
|
|
4411
4520
|
}
|
|
4412
4521
|
|
|
4413
4522
|
// src/commands/xray/index.ts
|