From aff10d193d66a1ccd0e7f432bb2a3861154d1bba Mon Sep 17 00:00:00 2001 From: APiankouski <109206864+apiankouski@users.noreply.github.com> Date: Fri, 26 Jul 2024 16:08:52 +0300 Subject: [PATCH] EPMRPP-93189 || Impossible to Post issue with "Parent" field --- .github/workflows/release.yml | 2 +- .../extension/jira/command/utils/JIRATicketUtils.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3fd9e5..7ea3814 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,6 +40,6 @@ jobs: - name: Release with Gradle id: release run: | - ./gradlew release -PreleaseMode --exclude-task checkUpdateNeeded -Pscripts.version=${{env.SCRIPTS_VERSION}} -Pbom.version=${{env.BOM_VERSION}} \ + ./gradlew release -PreleaseMode -Pscripts.version=${{env.SCRIPTS_VERSION}} -Pbom.version=${{env.BOM_VERSION}} \ -PgithubUserName=${{env.GH_USER_NAME}} -PgithubToken=${{secrets.GITHUB_TOKEN}} \ -PgpgPassphrase=${{secrets.GPG_PASSPHRASE}} -PgpgPrivateKey="${{secrets.GPG_PRIVATE_KEY}}" 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 0a81483..87dd305 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 @@ -21,6 +21,7 @@ import com.atlassian.jira.rest.client.api.JiraRestClient; import com.atlassian.jira.rest.client.api.domain.*; 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.ta.reportportal.commons.Predicates; @@ -60,6 +61,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() { } @@ -140,6 +143,13 @@ public static IssueInput toIssueInput(JiraRestClient client, Project jiraProject if (one.getId().equalsIgnoreCase(IssueFieldId.LINKS_FIELD.id)) { continue; } + if (one.getId().equalsIgnoreCase(PARENT_FIELD_ID)) { + if (!one.getValue().isEmpty()) { + issueInputBuilder.setFieldInput(new FieldInput(PARENT_FIELD_ID, + ComplexIssueInputFieldValue.with("key", one.getValue().get(0)))); + } + continue; + } // Arrays and fields with 'allowedValues' handler if (null != cimFieldInfo.getAllowedValues()) {