From 1d8e800620f5c57eb47dfb7501ad2402f101d604 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 20 Oct 2021 22:24:03 -0500 Subject: [PATCH] :zap: Simplify --- packages/nodes-base/nodes/Jira/Jira.node.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/nodes-base/nodes/Jira/Jira.node.ts b/packages/nodes-base/nodes/Jira/Jira.node.ts index 7a489368b1..3cd0509566 100644 --- a/packages/nodes-base/nodes/Jira/Jira.node.ts +++ b/packages/nodes-base/nodes/Jira/Jira.node.ts @@ -156,12 +156,8 @@ export class Jira implements INodeType { methods = { credentialTest: { async jiraSoftwareApiTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise { - let data; let domain; const credentials = credential.data; - domain = credentials!.domain; - data = Buffer.from(`${credentials!.email}:${credentials!.password || credentials!.apiToken}`).toString('base64'); - - const endpoint = '/api/2/project'; + const data = Buffer.from(`${credentials!.email}:${credentials!.password || credentials!.apiToken}`).toString('base64'); const options: OptionsWithUri = { headers: { @@ -171,7 +167,7 @@ export class Jira implements INodeType { 'X-Atlassian-Token': 'no-check', }, method: 'GET', - uri: `${domain}/rest${endpoint}`, + uri: `${credentials!.domain}/rest/api/2/project`, qs: { recent: 0, }, @@ -179,7 +175,7 @@ export class Jira implements INodeType { timeout: 5000, }; try { - const response = await this.helpers.request!(options); + await this.helpers.request!(options); } catch (err) { return { status: 'Error',