Skip to content

Commit 1fcede3

Browse files
committed
fix: use fixVersion instead of version for target version checking
1 parent ec6c90e commit 1fcede3

File tree

6 files changed

+23
-6
lines changed

6 files changed

+23
-6
lines changed

dist/index.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jira.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jira.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jira.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ export class Jira implements Adapter<Version2Client> {
8686
);
8787
}
8888

89-
return products.includes(this.issueDetails.product);
89+
if (this.issueDetails.fixVersions === undefined) {
90+
return false;
91+
}
92+
93+
return this.issueDetails.fixVersions.some(version =>
94+
products.includes(version)
95+
);
9096
}
9197

9298
isSeveritySet(): boolean {

test/unit/jira.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ describe('test Jira API', () => {
7373

7474
test<TestContext>('getUrl()', context => {
7575
context.jira.issueDetails = {
76+
type: 'Story',
7677
component: 'systemd',
7778
fixVersions: [],
7879
id: '123456789',
@@ -89,6 +90,7 @@ describe('test Jira API', () => {
8990

9091
test<TestContext>('getMarkdownUrl()', context => {
9192
context.jira.issueDetails = {
93+
type: 'Story',
9294
component: 'systemd',
9395
fixVersions: [],
9496
id: '123456789',
@@ -105,8 +107,9 @@ describe('test Jira API', () => {
105107

106108
test<TestContext>('isMatchingProduct()', context => {
107109
const issue: IssueDetails = {
110+
type: 'Story',
108111
component: 'systemd',
109-
fixVersions: [],
112+
fixVersions: ['Red Hat Enterprise Linux 9'],
110113
id: '123456789',
111114
product: 'Red Hat Enterprise Linux 9',
112115
summary: 'RHEL 9 bug',
@@ -123,6 +126,7 @@ describe('test Jira API', () => {
123126

124127
test<TestContext>('isMatchingComponent()', context => {
125128
const issue: IssueDetails = {
129+
type: 'Story',
126130
component: 'systemd',
127131
fixVersions: [],
128132
id: '123456789',
@@ -147,6 +151,7 @@ describe('test Jira API', () => {
147151
{ name: 'release', status: '+' },
148152
];
149153
let issue: IssueDetails = {
154+
type: 'Story',
150155
component: 'systemd',
151156
flags: flags,
152157
id: '123456789',

0 commit comments

Comments
 (0)