From d21dc2253adc476cc94323bdd586c3af3bba626b Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Fri, 26 Jul 2024 14:30:05 +0300 Subject: [PATCH 1/2] EPMRPP-93189 || Impossible to Post issue with "Parent" field --- .../extension/jira/command/utils/JIRATicketUtils.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/epam/reportportal/extension/jira/command/utils/JIRATicketUtils.java b/src/main/java/com/epam/reportportal/extension/jira/command/utils/JIRATicketUtils.java index 64006ab..a69ddbb 100755 --- a/src/main/java/com/epam/reportportal/extension/jira/command/utils/JIRATicketUtils.java +++ b/src/main/java/com/epam/reportportal/extension/jira/command/utils/JIRATicketUtils.java @@ -30,6 +30,7 @@ import com.atlassian.jira.rest.client.api.domain.Project; import com.atlassian.jira.rest.client.api.domain.User; import com.atlassian.jira.rest.client.api.domain.input.ComplexIssueInputFieldValue; +import com.atlassian.jira.rest.client.api.domain.input.FieldInput; import com.atlassian.jira.rest.client.api.domain.input.IssueInput; import com.atlassian.jira.rest.client.api.domain.input.IssueInputBuilder; import com.epam.reportportal.model.externalsystem.PostFormField; @@ -154,6 +155,13 @@ public static IssueInput toIssueInput(JiraRestClient client, Project jiraProject if (one.getId().equalsIgnoreCase(IssueFieldId.LINKS_FIELD.id)) { continue; } + if (one.getId().equalsIgnoreCase("parent")) { + if (!one.getValue().isEmpty()) { + issueInputBuilder.setFieldInput(new FieldInput("parent", + ComplexIssueInputFieldValue.with("key", one.getValue().get(0)))); + } + continue; + } // Arrays and fields with 'allowedValues' handler if (null != cimFieldInfo.getAllowedValues()) { From 7c1cf9d70ac2ec8fe57e9e19bee462799f3f09cd Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Fri, 26 Jul 2024 14:38:50 +0300 Subject: [PATCH 2/2] EPMRPP-93189 || Impossible to Post issue with "Parent" field --- .../extension/jira/command/utils/JIRATicketUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/epam/reportportal/extension/jira/command/utils/JIRATicketUtils.java b/src/main/java/com/epam/reportportal/extension/jira/command/utils/JIRATicketUtils.java index a69ddbb..b57f816 100755 --- a/src/main/java/com/epam/reportportal/extension/jira/command/utils/JIRATicketUtils.java +++ b/src/main/java/com/epam/reportportal/extension/jira/command/utils/JIRATicketUtils.java @@ -69,6 +69,8 @@ public class JIRATicketUtils { // Field format from UI calendar control public static final String JIRA_FORMAT = "yyyy-MM-dd"; + public static final String PARENT_FIELD_ID = "parent"; + private JIRATicketUtils() { } @@ -155,9 +157,9 @@ public static IssueInput toIssueInput(JiraRestClient client, Project jiraProject if (one.getId().equalsIgnoreCase(IssueFieldId.LINKS_FIELD.id)) { continue; } - if (one.getId().equalsIgnoreCase("parent")) { + if (one.getId().equalsIgnoreCase(PARENT_FIELD_ID)) { if (!one.getValue().isEmpty()) { - issueInputBuilder.setFieldInput(new FieldInput("parent", + issueInputBuilder.setFieldInput(new FieldInput(PARENT_FIELD_ID, ComplexIssueInputFieldValue.with("key", one.getValue().get(0)))); } continue;