From 4936f795dc13830f9259e5548b6063c58a52c035 Mon Sep 17 00:00:00 2001 From: Tomas Sebestik Date: Fri, 10 Mar 2023 12:35:35 +0100 Subject: [PATCH] ci:danger: Fix Jira ticket without any description --- .gitlab/dangerjs/mrDescriptionJiraLinks.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab/dangerjs/mrDescriptionJiraLinks.js b/.gitlab/dangerjs/mrDescriptionJiraLinks.js index 73497c9717..e407cbf7f1 100644 --- a/.gitlab/dangerjs/mrDescriptionJiraLinks.js +++ b/.gitlab/dangerjs/mrDescriptionJiraLinks.js @@ -1,4 +1,4 @@ -/** Check that there are valid JIRA links in MR desctiption. +/** Check that there are valid JIRA links in MR description. * * This check extracts the "Related" section from the MR description and * searches for JIRA ticket references in the format "Closes [JIRA ticket key]". @@ -179,9 +179,9 @@ module.exports = async function () { password: process.env.DANGER_JIRA_PASSWORD, }, }); - if (response.data.fields.description) { - jiraDescription = response.data.fields.description; - } + jiraDescription = response.data.fields.description + ? response.data.fields.description + : ""; // if the Jira ticket has an unfilled Description, the ".description" property is missing in API response - in that case set "jiraDescription" to an empty string } catch (error) { return null; }