Skip to content

Add support for link type between issues #964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 26, 2023
Merged

Conversation

jmini
Copy link
Collaborator

@jmini jmini commented Apr 24, 2023

Fixes #847


In https://docs.gitlab.com/ee/api/issue_links.html#create-an-issue-link

POST /projects/:id/issues/:issue_iid/links

Add link_type parameter in the request and attribute in the response


In https://docs.gitlab.com/ee/api/issue_links.html#list-issue-relations

GET /projects/:id/issues/:issue_iid/links

Add missing attributes to Issue:

    "link_type": "relates_to",
    "link_created_at": "2016-01-07T12:44:33.959Z",
    "link_updated_at": "2016-01-07T12:44:33.959Z"

There was already "issue_link_id"


This PR prepares an AbstractIssue class, this contains the common fields between:

Object tree would be:

  • Issue continues to extend AbstractIssue
    • Just subscribed would stay on the concrete Issue type.
    • The attribute from the linked issue would be removed (this is a breaking change can be done with 6.x.x).
  • LinkedIssue would have (also for 6.x.x):
    • issue_link_id
    • link_type
    • link_created_at
    • link_updated_at
  • The class EpicIssue (see EpicApi.getEpicIssues() returns models.Epic not models.EpicIssue #729) would also extends AbstractIssue with following attributes:
    • epic_issue_id
    • relative_position

On commit jmini@f63e2d9

I have tried a path where LinkedIssue would be a subtype of Issue to preserve backward compatibility.

But you can still not change the return value of method method getIssueLinks(..) from List<LinkedIssue> to List<LinkedIssue>.

public List<Issue> getIssueLinks(Object projectIdOrPath, Long issueIid) throws GitLabApiException {

But even if LinkedIssue is a subtype of Issue, this is a breaking change.


So changing the return type getIssueLinks(..) to LinkedIssue and refactoring Issue is something that could be done in 6.x.

@jmini jmini marked this pull request as ready for review April 26, 2023 07:37
@jabby jabby merged commit 999b6fb into gitlab4j:main Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for "link_type" in issue links
2 participants