From 0580fccabdb7b84e1c13b713c15cf8cbaf8d3353 Mon Sep 17 00:00:00 2001 From: Yury Brigadirenko Date: Mon, 2 Dec 2024 12:01:44 -0500 Subject: [PATCH] jira-task: properly handle create issue without priority (#182) --- .../walmartlabs/concord/plugins/jira/JiraTaskCommon.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/jira/src/main/java/com/walmartlabs/concord/plugins/jira/JiraTaskCommon.java b/tasks/jira/src/main/java/com/walmartlabs/concord/plugins/jira/JiraTaskCommon.java index 44b01de3..7f40f33b 100644 --- a/tasks/jira/src/main/java/com/walmartlabs/concord/plugins/jira/JiraTaskCommon.java +++ b/tasks/jira/src/main/java/com/walmartlabs/concord/plugins/jira/JiraTaskCommon.java @@ -129,7 +129,6 @@ Map createIssue(CreateIssueParams in) { String description = in.description(); String requestorUid = in.requestorUid(); String issueType = in.issueType(); - String issuePriority = in.issuePriority(); Map assignee = in.assignee(); List labels = in.labels(); List components = in.components(); @@ -141,7 +140,6 @@ Map createIssue(CreateIssueParams in) { try { //Build JSON data Map objProj = Collections.singletonMap("key", projectKey); - Map objPriority = Collections.singletonMap("name", issuePriority); Map objIssueType = Collections.singletonMap("name", issueType); Map objMain = new HashMap<>(); @@ -153,7 +151,10 @@ Map createIssue(CreateIssueParams in) { objMain.put("reporter", Collections.singletonMap("name", requestorUid)); } - objMain.put("priority", objPriority); + if (in.issuePriority() != null) { + objMain.put("priority", Map.of("name", in.issuePriority())); + } + objMain.put("issuetype", objIssueType); if (labels != null && !labels.isEmpty()) {