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:
|
Issue |
createIssue(java.lang.String projectKey,
Issue issue)
Deprecated.
|
IssueRelation |
createRelation(java.lang.Integer issueId,
java.lang.Integer issueToId,
java.lang.String type) |
TimeEntry |
createTimeEntry(TimeEntry obj) |
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 |
deleteTimeEntry(java.lang.Integer 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() |
java.util.List<Issue> |
getIssues(java.util.Map<java.lang.String,java.lang.String> pParameters)
Generic method to search for issues.
|
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<TimeEntry> |
getTimeEntries() |
java.util.List<TimeEntry> |
getTimeEntriesForIssue(java.lang.Integer issueId) |
TimeEntry |
getTimeEntry(java.lang.Integer id) |
java.util.List<TimeEntryActivity> |
getTimeEntryActivities() |
java.util.List<Tracker> |
getTrackers() |
void |
update(Issue obj) |
void |
update(TimeEntry 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 java.util.List<Issue> getIssues(java.util.Map<java.lang.String,java.lang.String> pParameters) throws RedmineException
pParameters - 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 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
RedmineException@Deprecated public Issue createIssue(java.lang.String projectKey, Issue issue) throws RedmineException
Sample usage:
Issue issueToCreate = IssueFactory.create();
issueToCreate.setSubject("This is the summary line 123");
Issue newIssue = mgr.createIssue(PROJECT_KEY, issueToCreate);
projectKey - The project "identifier". This is a string key like "project-ABC", NOT a database numeric ID.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 with the given projectKey is not foundRedmineExceptioncreateIssue(com.taskadapter.redmineapi.bean.Issue)public Issue createIssue(Issue issue) throws RedmineException
Issue issueToCreate = IssueFactory.create();
issueToCreate.setSubject("This is the summary line 123");
Project project = ProjectFactory.create(projectDatabaseId)
issueToCreate.setProject(project);
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 java.util.List<TimeEntry> getTimeEntries() throws RedmineException
RedmineExceptionpublic TimeEntry getTimeEntry(java.lang.Integer id) throws RedmineException
id - the database Id of the TimeEntry recordRedmineExceptionpublic java.util.List<TimeEntry> getTimeEntriesForIssue(java.lang.Integer issueId) throws RedmineException
RedmineExceptionpublic TimeEntry createTimeEntry(TimeEntry obj) throws RedmineException
RedmineExceptionpublic void deleteTimeEntry(java.lang.Integer id)
throws RedmineException
RedmineExceptionpublic java.util.List<TimeEntryActivity> getTimeEntryActivities() throws RedmineException
RedmineExceptionpublic void update(TimeEntry obj) 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