public class IssueManager
extends java.lang.Object
Obtain it via RedmineManager:
RedmineManager redmineManager = RedmineManagerFactory.createWithUserAuth(redmineURI, login, password); IssueManager issueManager = redmineManager.getIssueManager();
Sample usage:
Issue issue = issueManager.getIssueById(3205, Include.journals, Include.relations, Include.attachments); System.out.println(issue.getJournals());
RedmineManager.getIssueManager()| Modifier and Type | Method and Description |
|---|---|
void |
addWatcherToIssue(Watcher watcher,
Issue issue) |
IssueCategory |
createCategory(IssueCategory category)
creates a new
IssueCategory for the Project contained. |
Issue |
createIssue(Issue issue)
Sample usage:
|
IssueRelation |
createRelation(java.lang.Integer issueId,
java.lang.Integer issueToId,
java.lang.String type) |
void |
deleteCategory(IssueCategory category)
deletes an
IssueCategory. |
void |
deleteIssue(java.lang.Integer id) |
void |
deleteIssueRelations(Issue redmineIssue)
Delete all issue's relations
|
void |
deleteIssueRelationsByIssueId(java.lang.Integer issueId)
Delete relations for the given issue ID.
|
void |
deleteRelation(java.lang.Integer id)
Delete Issue Relation with the given Id.
|
void |
deleteWatcherFromIssue(Watcher watcher,
Issue issue) |
java.util.List<IssueCategory> |
getCategories(int projectID)
delivers a list of
IssueCategorys of a Project |
Issue |
getIssueById(java.lang.Integer id,
Include... include) |
java.util.List<IssuePriority> |
getIssuePriorities() |
ResultsWrapper<Issue> |
getIssues(java.util.Map<java.lang.String,java.lang.String> parameters)
Direct method to search for issues using any Redmine REST API parameters you want.
|
ResultsWrapper<Issue> |
getIssues(Params parameters)
Free-form search that does not do any paging for you.
|
java.util.List<Issue> |
getIssues(java.lang.String projectKey,
java.lang.Integer queryId,
Include... include) |
java.util.List<Issue> |
getIssuesBySummary(java.lang.String projectKey,
java.lang.String summaryField)
There could be several issues with the same summary, so the method returns List.
|
java.util.List<SavedQuery> |
getSavedQueries()
Get all "saved queries" available to the current user.
|
java.util.List<SavedQuery> |
getSavedQueries(java.lang.String projectKey)
Get "saved queries" for the given project available to the current user.
|
java.util.List<IssueStatus> |
getStatuses()
Delivers a list of existing
IssueStatuses. |
java.util.List<Tracker> |
getTrackers() |
void |
update(Issue obj) |
public java.util.List<Issue> getIssuesBySummary(java.lang.String projectKey, java.lang.String summaryField) throws RedmineException
RedmineAuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.NotFoundExceptionRedmineExceptionpublic ResultsWrapper<Issue> getIssues(java.util.Map<java.lang.String,java.lang.String> parameters) throws RedmineException
Unlike other getXXXObjects() methods in this library, this one does NOT handle paging for you so you have to provide "offset" and "limit" parameters if you want to control paging.
Sample usage:
final Map params = new HashMap();
params.put("project_id", projectId);
params.put("subject", "~free_form_search");
final List issues = issueManager.getIssues(params);
parameters - the http parameters key/value pairs to append to the rest api requestRedmineAuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.RedmineExceptionpublic ResultsWrapper<Issue> getIssues(Params parameters) throws RedmineException
Sample usage:
Params params = new Params()
.add("set_filter", "1")
.add("f[]", "summary")
.add("op[summary]", "~")
.add("v[summary]", "another")
.add("f[]", "description")
.add("op[description]", "~")
.add("v[description][]", "abc");
list = issueManager.getIssues(params);
parameters - RedmineExceptionpublic Issue getIssueById(java.lang.Integer id, Include... include) throws RedmineException
id - Redmine issue Idinclude - list of "includes". e.g. "relations", "journals", ...RedmineAuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.NotFoundException - the issue with the given id is not found on the serverRedmineExceptionpublic void addWatcherToIssue(Watcher watcher, Issue issue) throws RedmineException
RedmineExceptionpublic void deleteWatcherFromIssue(Watcher watcher, Issue issue) throws RedmineException
RedmineExceptionpublic Issue createIssue(Issue issue) throws RedmineException
Issue issueToCreate = IssueFactory.create(projectDatabaseId, subject);
Issue newIssue = mgr.createIssue(issueToCreate);
issue - the Issue object to create on the server.RedmineAuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.NotFoundException - the project is not foundRedmineExceptionpublic void deleteIssue(java.lang.Integer id)
throws RedmineException
RedmineExceptionpublic java.util.List<Issue> getIssues(java.lang.String projectKey, java.lang.Integer queryId, Include... include) throws RedmineException
projectKey - ignored if NULLqueryId - id of the saved query in Redmine. the query must be accessible to the user
represented by the API access key (if the Redmine project requires authorization).
This parameter is optional, NULL can be provided to get all available issues.RedmineAuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.RedmineExceptionIssuepublic IssueRelation createRelation(java.lang.Integer issueId, java.lang.Integer issueToId, java.lang.String type) throws RedmineException
issueId - id of the source issueissueToId - if of the target issuetype - type of the relation. e.g. "precedes". see IssueRelation.TYPE for possible types.RedmineExceptionIssueRelation.TYPEpublic void deleteRelation(java.lang.Integer id)
throws RedmineException
RedmineExceptionpublic void deleteIssueRelations(Issue redmineIssue) throws RedmineException
RedmineExceptionpublic void deleteIssueRelationsByIssueId(java.lang.Integer issueId)
throws RedmineException
issueId - issue IDRedmineExceptionpublic java.util.List<IssuePriority> getIssuePriorities() throws RedmineException
RedmineExceptionpublic void update(Issue obj) throws RedmineException
RedmineExceptionpublic java.util.List<IssueCategory> getCategories(int projectID) throws RedmineException
IssueCategorys of a ProjectprojectID - the ID of the ProjectIssueCategorys of the ProjectRedmineAuthenticationException - thrown in case something went wrong while trying to loginRedmineException - thrown in case something went wrong in RedmineNotFoundException - thrown in case an object can not be foundpublic IssueCategory createCategory(IssueCategory category) throws RedmineException
IssueCategory for the Project contained. Project for the IssueCategory must
not be null!category - the IssueCategory. Must contain a Project.IssueCategory created by Redminejava.lang.IllegalArgumentException - thrown in case the category does not contain a project.RedmineAuthenticationException - thrown in case something went wrong while trying to loginRedmineException - thrown in case something went wrong in RedmineNotFoundException - thrown in case an object can not be foundpublic void deleteCategory(IssueCategory category) throws RedmineException
IssueCategory. category - the IssueCategory.RedmineAuthenticationException - thrown in case something went wrong while trying to loginRedmineException - thrown in case something went wrong in RedmineNotFoundException - thrown in case an object can not be foundpublic java.util.List<IssueStatus> getStatuses() throws RedmineException
IssueStatuses.IssueStatuses.RedmineAuthenticationException - thrown in case something went wrong while trying to loginRedmineException - thrown in case something went wrong in RedmineNotFoundException - thrown in case an object can not be foundpublic java.util.List<Tracker> getTrackers() throws RedmineException
Trackers available (like "Bug", "Task", "Feature")RedmineAuthenticationException - thrown in case something went wrong while trying to loginRedmineException - thrown in case something went wrong in RedmineNotFoundException - thrown in case an object can not be foundpublic java.util.List<SavedQuery> getSavedQueries(java.lang.String projectKey) throws RedmineException
This REST API feature was added in Redmine 1.3.0. See http://www.redmine.org/issues/5737
RedmineExceptionpublic java.util.List<SavedQuery> getSavedQueries() throws RedmineException
This REST API feature was added in Redmine 1.3.0. See http://www.redmine.org/issues/5737
RedmineException