From 49852755473dbbb45e54b748f5785170984112cd Mon Sep 17 00:00:00 2001 From: maira-samtek <120603218+maira-samtek@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:35:19 -0400 Subject: [PATCH] fix(verbiage): changed variable names to match the verbiage (#216) * fix(verbiage): changed variable names to match the verbiage * fix(verbiage): renamed issue_key to issue_id * fix(verbiage): formatted --- src/libs/jira-lib.ts | 12 +++--------- src/macpro-security-hub-sync.ts | 6 +++--- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/libs/jira-lib.ts b/src/libs/jira-lib.ts index 255f707..28a3a21 100644 --- a/src/libs/jira-lib.ts +++ b/src/libs/jira-lib.ts @@ -195,22 +195,16 @@ export class Jira { throw new Error(`Error creating Jira issue: ${e.message}`); } } - async linkIssues( - newIssueKey: string, - featureIssueKey: string, - linkType = "Relates" - ) { + async linkIssues(newIssueKey: string, issueID: string, linkType = "Relates") { const linkData = { type: { name: linkType }, inwardIssue: { key: newIssueKey }, - outwardIssue: { key: featureIssueKey }, + outwardIssue: { key: issueID }, }; try { await this.jira.issueLink(linkData); - console.log( - `Successfully linked issue ${newIssueKey} with ${featureIssueKey}` - ); + console.log(`Successfully linked issue ${newIssueKey} with ${issueID}`); } catch (error) { console.error("Error linking issues:", error); } diff --git a/src/macpro-security-hub-sync.ts b/src/macpro-security-hub-sync.ts index 1942156..831f3c3 100644 --- a/src/macpro-security-hub-sync.ts +++ b/src/macpro-security-hub-sync.ts @@ -333,13 +333,13 @@ export class SecurityHubJiraSync { let newIssueInfo; try { newIssueInfo = await this.jira.createNewIssue(newIssueData); - const feature_key = process.env.JIRA_LINK_ID ?? ""; - if (feature_key) { + const issue_id = process.env.JIRA_LINK_ID ?? ""; + if (issue_id) { let linkType = "Relates"; if (process.env.JIRA_LINK_TYPE) { linkType = process.env.JIRA_LINK_TYPE; } - await this.jira.linkIssues(newIssueInfo.key, feature_key, linkType); + await this.jira.linkIssues(newIssueInfo.key, issue_id, linkType); } } catch (e: any) { throw new Error(`Error creating Jira issue from finding: ${e.message}`);