Skip to content

EpicApi.getEpicIssues() returns models.Epic not models.EpicIssue #729

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

Closed
Zojii opened this issue Jul 9, 2021 · 1 comment · Fixed by #969
Closed

EpicApi.getEpicIssues() returns models.Epic not models.EpicIssue #729

Zojii opened this issue Jul 9, 2021 · 1 comment · Fixed by #969

Comments

@Zojii
Copy link

Zojii commented Jul 9, 2021

Shouldn't the below code returning List ? Happy to contribute if the below isn't the intended behavior. There are several other epicIssue methods return epics.

List getEpicIssues

public Pager getEpicIssues.

public Stream getEpicIssuesStr.

/**
     * Gets all issues that are assigned to an epic and the authenticated user has access to
     * using the specified page and per page setting.
     *
     * <pre><code>GitLab Endpoint: GET /groups/:id/epics/:epic_iid/issues</code></pre>
     *
     * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
     * @param epicIid the IID of the epic to get issues for
     * @param page the page to get
     * @param perPage the number of issues per page
     * @return a list of all epic issues belonging to the specified epic in the specified range
     * @throws GitLabApiException if any exception occurs
     */
    public List<Epic> getEpicIssues(Object groupIdOrPath, Integer epicIid, int page, int perPage) throws GitLabApiException {
        Response response = get(Response.Status.OK, getPageQueryParams(page, perPage), "groups", getGroupIdOrPath(groupIdOrPath), "epics", epicIid, "issues");
        return (response.readEntity(new GenericType<List<Epic>>() { }));
    }
    ```
@jmini
Copy link
Collaborator

jmini commented Apr 26, 2023

I totally agree with this issue.


This is a little bit the same story as what I have described here: #964 (comment)

We need an AbstractIssue type containing most of the current Issue attributes.

  • Issue would extends AbstractIssue
    • Just subscribed would stay on the concrete Issue type.
  • The class EpicIssue would also extends AbstractIssue instead of Issue as it is now with following attributes:
    • epic_issue_id Long
    • relative_position Integer

I guess getEpicIssues(..) is not working for anybody, so for me it would be OK to change that now on 5.x.x

jmini added a commit to jmini/gitlab4j-api that referenced this issue Apr 27, 2023
@jabby jabby closed this as completed in #969 May 5, 2023
jabby pushed a commit that referenced this issue May 5, 2023
* Fix Epic Issue link association

Fixes #729

* Change return type
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 a pull request may close this issue.

2 participants