Skip to content

Commit

Permalink
jira-task: properly handle create issue without priority (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
brig authored Dec 2, 2024
1 parent 8c56991 commit 0580fcc
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ Map<String, Object> createIssue(CreateIssueParams in) {
String description = in.description();
String requestorUid = in.requestorUid();
String issueType = in.issueType();
String issuePriority = in.issuePriority();
Map<String, Object> assignee = in.assignee();
List<String> labels = in.labels();
List<String> components = in.components();
Expand All @@ -141,7 +140,6 @@ Map<String, Object> createIssue(CreateIssueParams in) {
try {
//Build JSON data
Map<String, Object> objProj = Collections.singletonMap("key", projectKey);
Map<String, Object> objPriority = Collections.singletonMap("name", issuePriority);
Map<String, Object> objIssueType = Collections.singletonMap("name", issueType);

Map<String, Object> objMain = new HashMap<>();
Expand All @@ -153,7 +151,10 @@ Map<String, Object> 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()) {
Expand Down

0 comments on commit 0580fcc

Please sign in to comment.