Skip to content

Commit 36a416c

Browse files
committed
include jira link when closing GH
1 parent 077cae0 commit 36a416c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/syncJiraToGitHub.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,12 @@ export async function closeGitHubIssueIfJiraClosed(jiraIssue, githubIssue) {
332332
issueNumber,
333333
`Closed via Jira sync - Jira issue ${jiraIssue.key} is closed.`
334334
);
335+
// Add Jira link to GitHub issue body if not already present
336+
const githubIssueForLink = {
337+
url: githubIssue.url,
338+
body: ghIssue.body || '',
339+
};
340+
await addJiraLinkToGitHub(jiraIssue.key, githubIssueForLink);
335341
console.log(
336342
` - Closed GitHub issue ${owner}/${repo}#${issueNumber} (Jira ${jiraIssue.key} is closed)`
337343
);
@@ -409,6 +415,12 @@ export async function checkAndHandleArchivedJiraIssue(githubIssue) {
409415
issueNumber,
410416
`Closed via Jira sync - Jira issue ${jiraKey} was archived.`
411417
);
418+
// Add Jira link to GitHub issue body if not already present
419+
const githubIssueForLink = {
420+
url: githubIssue.url,
421+
body: ghIssue.body || '',
422+
};
423+
await addJiraLinkToGitHub(jiraKey, githubIssueForLink);
412424
console.log(
413425
` - Closed GitHub issue ${owner}/${repo}#${issueNumber} (Jira ${jiraKey} is archived)`
414426
);
@@ -488,6 +500,12 @@ export async function closeGitHubIssuesForClosedJira(closedJiraIssues) {
488500
issueNumber,
489501
`Closed via Jira sync - Jira issue ${jiraIssue.key} was closed.`
490502
);
503+
// Add Jira link to GitHub issue body if not already present
504+
const githubIssueForLink = {
505+
url: githubUrl,
506+
body: ghIssue.body || '',
507+
};
508+
await addJiraLinkToGitHub(jiraIssue.key, githubIssueForLink);
491509
console.log(
492510
` - Closed GitHub issue ${owner}/${repo}#${issueNumber} (Jira ${jiraIssue.key} was closed)`
493511
);

0 commit comments

Comments
 (0)