File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
src/GitReleaseManager.Core/Provider Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -391,10 +391,23 @@ public string GetIssueType(Issue issue)
391391 return issue . IsPullRequest ? "Merge Request" : "Issue" ;
392392 }
393393
394- public async Task < Issue > GetLinkedIssueAsync ( string owner , string repository , int issueNumber )
394+ public Task < IEnumerable < Issue > > GetLinkedIssuesAsync ( string owner , string repository , Issue issue )
395395 {
396- // This is a placeholder until I figure out if GitLab has a something equivalent to GitHub's "linked issue"
397- throw new NotImplementedException ( ) ;
396+ return ExecuteAsync ( ( ) =>
397+ {
398+ if ( issue . IsPullRequest )
399+ {
400+ var closes = _gitLabClient . MergeRequests . ClosesIssues ( issue . PublicNumber ) ;
401+ var issues = _mapper . Map < IEnumerable < Issue > > ( closes ) ;
402+ return Task . FromResult ( issues ) ;
403+ }
404+ else
405+ {
406+ var closedBy = _gitLabClient . Issues . ClosedBy ( GetGitLabProjectId ( owner , repository ) , issue . PublicNumber ) ;
407+ var issues = _mapper . Map < IEnumerable < Issue > > ( closedBy ) ;
408+ return Task . FromResult ( issues ) ;
409+ }
410+ } ) ;
398411 }
399412
400413 private int GetGitLabProjectId ( string owner , string repository )
You can’t perform that action at this time.
0 commit comments