gitlab4j / gitlab4j-api

GitLab4J API (gitlab4j-api) provides a full featured Java client library for working with GitLab repositories via the GitLab REST API
MIT License
1.07k stars 463 forks source link

There is no related_merge_requests method in IssuesApi #861

Open kolybelkin opened 2 years ago

kolybelkin commented 2 years ago

Gitlab has a method for getting all linked merge requests from issue, here is the link for the documentation - https://docs.gitlab.com/ee/api/issues.html#list-merge-requests-related-to-issue

I tried to customize IssueApi class and added the following method which works as expected

fun getRelatedMergeRequests(projectIdOrPath: Any?, issueIid: Long?): List<MergeRequest> {
        return Pager(
            this, MergeRequest::class.java, defaultPerPage, null,
            "projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "related_merge_requests"
        ).all()
    }
kolybelkin commented 2 years ago

Has it already implemented in some private non-released version? If not, I can create a pull request with these changes, just let me know