-
Notifications
You must be signed in to change notification settings - Fork 486
Closed
Description
According to https://docs.gitlab.com/ee/api/issue_links.html
Endpoint:
POST /projects/:id/issues/:issue_iid/links
Supports a link_type query parameter:
Type: string
Required: no
Description: The type of the relation (“relates_to”, “blocks”, “is_blocked_by”), defaults to “relates_to”).
So this would needs to be reflected here:
gitlab4j-api/src/main/java/org/gitlab4j/api/IssuesApi.java
Lines 847 to 871 in 075ce39
| /** | |
| * Creates a two-way relation between two issues. User must be allowed to update both issues in order to succeed. | |
| * | |
| * <p>NOTE: Only available in GitLab Starter, GitLab Bronze, and higher tiers.</p> | |
| * | |
| * <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/links</code></pre> | |
| * | |
| * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance | |
| * @param issueIid the internal ID of a project's issue | |
| * @param targetProjectIdOrPath the project in the form of an Long(ID), String(path), or Project instance of the target project | |
| * @param targetIssueIid the internal ID of a target project’s issue | |
| * @return an instance of IssueLink holding the link relationship | |
| * @throws GitLabApiException if any exception occurs | |
| */ | |
| public IssueLink createIssueLink(Object projectIdOrPath, Long issueIid, | |
| Object targetProjectIdOrPath, Long targetIssueIid) throws GitLabApiException { | |
| GitLabApiForm formData = new GitLabApiForm() | |
| .withParam("target_project_id", getProjectIdOrPath(targetProjectIdOrPath), true) | |
| .withParam("target_issue_iid", targetIssueIid, true); | |
| Response response = post(Response.Status.OK, formData.asMap(), | |
| "projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "links"); | |
| return (response.readEntity(IssueLink.class)); | |
| } |
Maybe as enum?
And it needs to be present in IssueLink class (link_type attribute), when the response is parsed:
[
{
"id" : 84,
"iid" : 14,
"issue_link_id": 1,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "Issues with auth",
"state" : "opened",
"assignees" : [],
"assignee" : null,
"labels" : [
"bug"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/14",
"confidential": false,
"weight": null,
"link_type": "relates_to",
"link_created_at": "2016-01-07T12:44:33.959Z",
"link_updated_at": "2016-01-07T12:44:33.959Z"
}
]Also the method reading the issue links GET /projects/:id/issues/:issue_iid/links should be reworked:
getIssueLinks(Object projectIdOrPath, Long issueIid)getIssueLinks(Object projectIdOrPath, Long issueIid, int itemsPerPage)getIssueLinksStream(Object projectIdOrPath, Long issueIid)
But there I am not sure to understand why the return type is not from type IssueLink…
Metadata
Metadata
Assignees
Labels
No labels