From e0312ef8b7162eccc4174903291cf0361ec44cee Mon Sep 17 00:00:00 2001 From: d-r-e <9976038+d-r-e@users.noreply.github.com> Date: Tue, 17 Sep 2024 09:04:16 +0200 Subject: [PATCH 1/2] Fix #3447 Time submission on Gitlab Fixed an error reported in #3447 for which the issueId instead of iid was used for time submission to Gitlab. --- .../issue/providers/gitlab/gitlab-api/gitlab-api.service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/features/issue/providers/gitlab/gitlab-api/gitlab-api.service.ts b/src/app/features/issue/providers/gitlab/gitlab-api/gitlab-api.service.ts index a8ca92fa134..24400826db6 100644 --- a/src/app/features/issue/providers/gitlab/gitlab-api/gitlab-api.service.ts +++ b/src/app/features/issue/providers/gitlab/gitlab-api/gitlab-api.service.ts @@ -212,12 +212,13 @@ export class GitlabApiService { time_estimate: null | number; total_time_spent: null | number; }*/ + const iid = this._getIidFromIssue(issueId); return this._sendRawRequest$( { url: `${this._apiLink( cfg, cfg.project || undefined, - )}/issues/${issueId}/add_spent_time`, + )}/issues/${iid}/add_spent_time`, method: 'POST', data: { duration, @@ -242,7 +243,7 @@ export class GitlabApiService { url: `${this._apiLink( cfg, cfg.project || undefined, - )}/issues/${issueId}/time_stats`, + )}/issues/${this._getIidFromIssue(issueId)}/time_stats`, }, cfg, ).pipe(map((res) => (res as any).body)); From 71a1d227c4574dd562bc10b95577b2e5324f7d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez=20Elipe?= Date: Tue, 17 Sep 2024 10:56:54 +0200 Subject: [PATCH 2/2] Fix # 3447 time submitting used wrong id on Gitlab --- .../issue/providers/gitlab/gitlab-api/gitlab-api.service.ts | 4 ++-- .../providers/gitlab/gitlab-common-interfaces.service.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/features/issue/providers/gitlab/gitlab-api/gitlab-api.service.ts b/src/app/features/issue/providers/gitlab/gitlab-api/gitlab-api.service.ts index 24400826db6..60fef29d437 100644 --- a/src/app/features/issue/providers/gitlab/gitlab-api/gitlab-api.service.ts +++ b/src/app/features/issue/providers/gitlab/gitlab-api/gitlab-api.service.ts @@ -212,13 +212,13 @@ export class GitlabApiService { time_estimate: null | number; total_time_spent: null | number; }*/ - const iid = this._getIidFromIssue(issueId); + return this._sendRawRequest$( { url: `${this._apiLink( cfg, cfg.project || undefined, - )}/issues/${iid}/add_spent_time`, + )}/issues/${issueId}/add_spent_time`, method: 'POST', data: { duration, diff --git a/src/app/features/issue/providers/gitlab/gitlab-common-interfaces.service.ts b/src/app/features/issue/providers/gitlab/gitlab-common-interfaces.service.ts index e04a82f2d15..244ac53860b 100644 --- a/src/app/features/issue/providers/gitlab/gitlab-common-interfaces.service.ts +++ b/src/app/features/issue/providers/gitlab/gitlab-common-interfaces.service.ts @@ -215,7 +215,7 @@ export class GitlabCommonInterfacesService implements IssueServiceInterface { issuePoints: issue.weight, issueWasUpdated: false, issueLastUpdated: new Date(issue.updated_at).getTime(), - issueId: issue.id as string, + issueId: issue.number.toString(), }; }