From 6d3ee256b05e913f1a7338f92bac3879985d12ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20R=C3=BCsch?= <78490564+maximilianruesch@users.noreply.github.com> Date: Sun, 3 Dec 2023 15:49:19 +0100 Subject: [PATCH] Fix moving issues between backlog and sprints (#76) --- .../jira-server-provider/JiraServerProvider.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/electron/providers/jira-server-provider/JiraServerProvider.ts b/electron/providers/jira-server-provider/JiraServerProvider.ts index 8390acc5..7e3e3058 100644 --- a/electron/providers/jira-server-provider/JiraServerProvider.ts +++ b/electron/providers/jira-server-provider/JiraServerProvider.ts @@ -291,24 +291,16 @@ export class JiraServerProvider implements IProvider { async moveIssueToSprintAndRank( sprint: number, issue: string, - rankBefore: string, - rankAfter: string ): Promise { return new Promise((resolve, reject) => { - const rankCustomField = this.customFields.get("Rank") this.getAgileRestApiClient('1.0') .post( `/sprint/${sprint}/issue`, - { - rankCustomFieldId: rankCustomField!.match(/_(\d+)/)![1], - issues: [issue], - ...(rankAfter && { rankAfterIssue: rankAfter }), - ...(rankBefore && { rankBeforeIssue: rankBefore }), - } + { issues: [issue] } // Ranking issues in the sprints is not supported by Jira server ) .then(() => resolve()) .catch((error) => { - reject(new Error(`Error in moving this issue to the Sprint with id ${sprint}: ${error}`)) + reject(new Error(`Error in moving this issue to the Sprint with id ${sprint}: ${JSON.stringify(error.response.data)}`)) }) }) } @@ -352,7 +344,7 @@ export class JiraServerProvider implements IProvider { .put('/issue/rank', body) .then(() => resolve()) .catch((error) => - reject(new Error(`Error in moving this issue to the Backlog: ${error}`)) + reject(new Error(`Error in ranking this issue in the Backlog: ${error}`)) ) }) }