jira-sprinter 1.0.1 → 1.0.3

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 CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  [![npm version][npm-status]][npm] [![Tests][test-status]][test] [![Linters][lint-status]][lint] [![CodeQL][codeql-status]][codeql] [![codecov][codecov-status]][codecov]
4
4
 
5
- [npm]: https://www.npmjs.com/package/sprinter
6
- [npm-status]: https://img.shields.io/npm/v/sprinter
5
+ [npm]: https://www.npmjs.com/package/jira-sprinter
6
+ [npm-status]: https://img.shields.io/npm/v/jira-sprinter
7
7
 
8
8
  [test]: https://github.com/redhat-plumbers-in-action/sprinter/actions/workflows/tests.yml
9
9
  [test-status]: https://github.com/redhat-plumbers-in-action/sprinter/actions/workflows/tests.yml/badge.svg
package/dist/main.js CHANGED
@@ -36560,7 +36560,7 @@ var Jira = class {
36560
36560
  });
36561
36561
  return response.values;
36562
36562
  }
36563
- async getIssuesInSprint(sprintId, assignee = void 0, issuesWithoutTasks = true) {
36563
+ async getIssuesInSprint(sprintId, assignee, issuesWithoutTasks = true) {
36564
36564
  let jql = assignee ? `assignee = "${assignee}"` : "";
36565
36565
  jql += issuesWithoutTasks ? ` AND ${this.issuesWithoutTasksJQL}` : "";
36566
36566
  const response = await this.agile.sprint.getIssuesForSprint({
@@ -36636,8 +36636,8 @@ var Jira = class {
36636
36636
  }
36637
36637
  async setValues(issue2, values) {
36638
36638
  const assigneeValue = values.assignee ? { [this.fields.assignee]: { name: values.assignee } } : {};
36639
- const storyPointsValue = values.size ? { [this.fields.storyPoints]: values.size } : {};
36640
- const sprintValue = values.sprint === void 0 ? {} : { [this.fields.sprint]: values.sprint };
36639
+ const storyPointsValue = values.size !== void 0 ? { [this.fields.storyPoints]: values.size } : {};
36640
+ const sprintValue = values.sprint !== void 0 ? { [this.fields.sprint]: values.sprint } : {};
36641
36641
  await this.api.issues.editIssue({
36642
36642
  issueIdOrKey: issue2,
36643
36643
  fields: { ...assigneeValue, ...storyPointsValue, ...sprintValue }
@@ -49310,7 +49310,7 @@ var issueStatusSchema = external_exports2.union([
49310
49310
  // src/cli.ts
49311
49311
  function cli() {
49312
49312
  const program2 = new Command();
49313
- program2.name("jira-sprinter").description("\u{1F3C3} Small CLI tool to manage sprints in JIRA Board").version("1.0.0");
49313
+ program2.name("jira-sprinter").description("\u{1F3C3} Small CLI tool to manage sprints in JIRA Board").version("1.0.3");
49314
49314
  program2.option("-b, --board [board]", "Jira Board ID", getDefaultValue("BOARD")).option(
49315
49315
  "-a, --assignee [assignee]",
49316
49316
  "Jira Assignee",
@@ -49342,10 +49342,11 @@ var runProgram = async () => {
49342
49342
  })),
49343
49343
  {
49344
49344
  name: `${source_default.bold("Backlog")}`,
49345
+ disabled: true,
49345
49346
  value: -1
49346
49347
  }
49347
49348
  ],
49348
- default: -1,
49349
+ default: sprints.find((sprint) => sprint.state === "future")?.id ?? void 0,
49349
49350
  pageSize: 5,
49350
49351
  loop: false
49351
49352
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jira-sprinter",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Small CLI tool to manage sprints in JIRA Board",
5
5
  "main": "src/main.ts",
6
6
  "type": "commonjs",
package/src/cli.ts CHANGED
@@ -23,7 +23,7 @@ export function cli(): Command {
23
23
  program
24
24
  .name('jira-sprinter')
25
25
  .description('🏃 Small CLI tool to manage sprints in JIRA Board')
26
- .version('1.0.0');
26
+ .version('1.0.3');
27
27
 
28
28
  program
29
29
  .option('-b, --board [board]', 'Jira Board ID', getDefaultValue('BOARD'))
@@ -67,10 +67,11 @@ const runProgram = async () => {
67
67
  })),
68
68
  {
69
69
  name: `${chalk.bold('Backlog')}`,
70
+ disabled: true,
70
71
  value: -1,
71
72
  },
72
73
  ],
73
- default: -1,
74
+ default: sprints.find(sprint => sprint.state === 'future')?.id ?? undefined,
74
75
  pageSize: 5,
75
76
  loop: false,
76
77
  });
package/src/jira.ts CHANGED
@@ -60,7 +60,7 @@ export class Jira {
60
60
 
61
61
  async getIssuesInSprint(
62
62
  sprintId: number,
63
- assignee: string | undefined = undefined,
63
+ assignee?: string,
64
64
  issuesWithoutTasks: boolean = true
65
65
  ): Promise<SearchResults['issues']> {
66
66
  let jql = assignee ? `assignee = "${assignee}"` : '';
@@ -159,13 +159,14 @@ export class Jira {
159
159
  const assigneeValue = values.assignee
160
160
  ? { [this.fields.assignee]: { name: values.assignee } }
161
161
  : {};
162
- const storyPointsValue = values.size
163
- ? { [this.fields.storyPoints]: values.size }
164
- : {};
162
+ const storyPointsValue =
163
+ values.size !== undefined
164
+ ? { [this.fields.storyPoints]: values.size }
165
+ : {};
165
166
  const sprintValue =
166
- values.sprint === undefined
167
- ? {}
168
- : { [this.fields.sprint]: values.sprint };
167
+ values.sprint !== undefined
168
+ ? { [this.fields.sprint]: values.sprint }
169
+ : {};
169
170
 
170
171
  await this.api.issues.editIssue({
171
172
  issueIdOrKey: issue,