Skip to content

getVersions() returns versions from other projects #383

@zaraterdz

Description

@zaraterdz

Expected behavior: The getVersions(projectID) method should only return versions from a specific project.

Current behavior: The method is returning versions from multiple projects, even though it is passed a specific projectID.

Library Version: redmine-java-api 3.1.2

Description: When using the getVersions method with a specific projectID, the returned list of versions contains versions that belong to other projects, which is not the expected behavior.

Code snippets:

`@Override
public Sprint getSprintByName(String projectKey, String sprintName) throws IssueTrackerException {
try {
Project project = manager.getProjectManager().getProjectByKey(projectKey);
List versions = manager.getProjectManager().getVersions(project.getId());

    for (Version version : versions) {
        if (version.getName().equals(sprintName) && version.getId().equals(project.getId())) {
            return new RedmineSprintBuilder(version).build();
        }
    }
    throw new NotFoundException("version not found in project '" + projectKey + "'.");
} catch (RedmineException ex) {
    throw new IssueTrackerException("");
}

}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions