From 45bdeac730f752f0547761d82f4132ae416f0c30 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Tue, 17 Jan 2023 13:41:43 +0200 Subject: [PATCH] Fix pull request API field `closed_at` always being `null` (#22482) (#22483) Backport #22482 Fix #22480 --- modules/convert/pull.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/convert/pull.go b/modules/convert/pull.go index 9c31f9bd2..5eb3cba5a 100644 --- a/modules/convert/pull.go +++ b/modules/convert/pull.go @@ -89,6 +89,10 @@ func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *u }, } + if pr.Issue.ClosedUnix != 0 { + apiPullRequest.Closed = pr.Issue.ClosedUnix.AsTimePtr() + } + gitRepo, err := git.OpenRepository(ctx, pr.BaseRepo.RepoPath()) if err != nil { log.Error("OpenRepository[%s]: %v", pr.BaseRepo.RepoPath(), err)