Skip to content

Commit b8ce4ec

Browse files
committed
SP-2020 remove releaseDate and customfield_11108 usage
1 parent 7c1fa30 commit b8ce4ec

File tree

6 files changed

+7
-25
lines changed

6 files changed

+7
-25
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ A GitHub action that uses a tag name and a list of Issue-IDs and updates their r
3434
- `issueIds` (required) - Comma separated list of Jira issues to update. Example: RE-1486,RE-1489
3535
- `componentName` (required) - The name of the component (service) to add as label to the issues
3636
- `tagName` (required) - The (git) release tag to add as label to the issues
37-
- `releaseDate` (optional) - The date to use as release date, default is 'now'
3837
- `notifyUsers` (optional) - Whether to notify user watching the Jira issues, default is 'false'
3938

4039
## Contributing

__tests__/jira.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ xtest('foo', async () => {
77
const result = await jira.updateIssues({
88
issueIds: ['RE-1486', 'RE-1489'],
99
componentName: 'foo-service',
10-
tagName: '2020.8.4',
11-
releaseDate: new Date(),
10+
tagName: '2020.8.4'
1211
})
1312

1413
expect(result).toEqual([])

action.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ const arn = new Arn({webhookUrl});
1515
// 1. update JIRA issues
1616
// 2. send a webhook to the ARN (Automated release notes) - JIRA app -
1717
// with the componentName-tagName label
18-
async function exec ({ issueIds, componentName, tagName, releaseDate }) {
18+
async function exec ({ issueIds, componentName, tagName }) {
1919
try {
20-
console.log({ issueIds, componentName, tagName, releaseDate });
20+
console.log({ issueIds, componentName, tagName });
2121

2222
if (issueIds.length === 0) {
2323
console.log('No Jira issues given, do nothing');
@@ -29,7 +29,6 @@ async function exec ({ issueIds, componentName, tagName, releaseDate }) {
2929
issueIds,
3030
componentName,
3131
tagName,
32-
releaseDate,
3332
});
3433

3534
if (errors.length === 0) {
@@ -51,7 +50,6 @@ function parseArgs() {
5150
issueIds: filterIssueIds(core.getInput('issueIds')),
5251
componentName: core.getInput('componentName'),
5352
tagName: core.getInput('tagName') || process.env.TAGNAME,
54-
releaseDate: core.getInput('releaseDate') ? new Date(core.getInput('releaseDate')) : new Date(),
5553
notifyUsers: core.getInput('notifyUsers') === 'true',
5654
}
5755
}

action.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ inputs:
1313
tagName:
1414
description: "The (git) release tag to add as label to the issues"
1515
required: true
16-
releaseDate:
17-
description: "The date to use as release date, default is 'now'"
18-
required: false
1916
notifyUsers:
2017
description: "Whether to notify user watching the Jira issues, default is 'false'"
2118
required: false

dist/index.js

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

jira.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,12 @@ class Jira {
3535
return issue;
3636
}
3737

38-
async updateIssues ({ issueIds, releaseDate, tagName, componentName, notifyUsers = false }) {
38+
async updateIssues ({ issueIds, tagName, componentName, notifyUsers = false }) {
3939
const calls = issueIds.map(async (issueId) => {
4040
try {
4141
const issue = await this.getIssueOrSubtaskParentIssue(issueId);
4242

43-
if (issue.fields.customfield_11108) {
44-
const oldReleaseDate = new Date(issue.fields.customfield_11108);
45-
46-
if (oldReleaseDate > releaseDate) {
47-
releaseDate = oldReleaseDate
48-
}
49-
}
50-
51-
await this.updateIssue({ issue, releaseDate, tagName, componentName, notifyUsers });
43+
await this.updateIssue({ issue, tagName, componentName, notifyUsers });
5244

5345
return null
5446
} catch (ex) {
@@ -63,7 +55,7 @@ class Jira {
6355

6456
// PUT /rest/api/3/issue/{issueIdOrKey}
6557
// see: https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-rest-api-3-issue-issueIdOrKey-put
66-
async updateIssue ({ issue, releaseDate, tagName, componentName, notifyUsers }) {
58+
async updateIssue ({ issue, tagName, componentName, notifyUsers }) {
6759
const issueId = issue.key;
6860
//console.log('Updating ' + issueId);
6961
const response = await fetch(`${this.baseUrl}/rest/api/3/issue/${issueId}?notifyUsers=${notifyUsers}`, {
@@ -83,9 +75,6 @@ class Jira {
8375
},
8476
],
8577
},
86-
fields: {
87-
customfield_11108: releaseDate.toISOString(),
88-
},
8978
}),
9079
});
9180

0 commit comments

Comments
 (0)