Skip to content

Commit

Permalink
Merge pull request #11 from iriusrisk/hotfix/IR-6527
Browse files Browse the repository at this point in the history
[IR-6527] set max results to get issues
  • Loading branch information
ToniMateuSanchez authored Jul 7, 2022
2 parents 40f1334 + c7854af commit f7ec943
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed
-[IR-6527](https://continuumsecurity.atlassian.net/browse/IR-6527) Set max results when getting the issues

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>net.rcarz</groupId>
<artifactId>jira-client</artifactId>
<version>0.7.6-IRIUS</version>
<version>0.8.0-IRIUS-SNAPSHOT</version>
<packaging>jar</packaging>

<name>jira-client</name>
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/net/rcarz/jiraclient/JiraClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ public Issue getIssue(String key) throws JiraException {
* @throws JiraException when something goes wrong
*/
public List<Issue> getIssues(String project, List<String> keys) throws JiraException {
return getIssues(project, keys, null);
}

/**
* Retrieves the issues with the given keys.
*
* @param keys Issue key list (["PROJECT-123","PROJECT-124"])
* @param maxResults limit the number of results
* @return an issue list instance (issue includes all fields)
* @throws JiraException when something goes wrong
*/
public List<Issue> getIssues(String project, List<String> keys, Integer maxResults) throws JiraException {
if (keys.isEmpty()) {
return new ArrayList<Issue>();
} else {
Expand All @@ -168,7 +180,7 @@ public List<Issue> getIssues(String project, List<String> keys) throws JiraExcep
sb.append(s);
sb.append(", ");
}
return searchIssues("project = " + project + " AND Issuekey IN (" + sb.substring(0, sb.length() - 2) + ")").issues;
return searchIssues("project = " + project + " AND Issuekey IN (" + sb.substring(0, sb.length() - 2) + ")", maxResults).issues;
}
}

Expand Down

0 comments on commit f7ec943

Please sign in to comment.