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
IssueCategory s 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
IssueStatus es. |
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.NotFoundException
RedmineException
public 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.RedmineException
public 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 serverRedmineException
public void addWatcherToIssue(Watcher watcher, Issue issue) throws RedmineException
RedmineException
public 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 foundRedmineException
createIssue(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 foundRedmineException
public void deleteIssue(java.lang.Integer id) throws RedmineException
RedmineException
public 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.RedmineException
Issue
public 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.RedmineException
IssueRelation.TYPE
public void deleteRelation(java.lang.Integer id) throws RedmineException
RedmineException
public void deleteIssueRelations(Issue redmineIssue) throws RedmineException
RedmineException
public void deleteIssueRelationsByIssueId(java.lang.Integer issueId) throws RedmineException
issueId
- issue IDRedmineException
public java.util.List<IssuePriority> getIssuePriorities() throws RedmineException
RedmineException
public java.util.List<TimeEntry> getTimeEntries() throws RedmineException
RedmineException
public TimeEntry getTimeEntry(java.lang.Integer id) throws RedmineException
id
- the database Id of the TimeEntry recordRedmineException
public java.util.List<TimeEntry> getTimeEntriesForIssue(java.lang.Integer issueId) throws RedmineException
RedmineException
public TimeEntry createTimeEntry(TimeEntry obj) throws RedmineException
RedmineException
public void deleteTimeEntry(java.lang.Integer id) throws RedmineException
RedmineException
public java.util.List<TimeEntryActivity> getTimeEntryActivities() throws RedmineException
RedmineException
public void update(TimeEntry obj) throws RedmineException
RedmineException
public void update(Issue obj) throws RedmineException
RedmineException
public java.util.List<IssueCategory> getCategories(int projectID) throws RedmineException
IssueCategory
s of a Project
projectID
- the ID of the Project
IssueCategory
s of the 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 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
IssueStatus
es.IssueStatus
es.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
Tracker
s 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
RedmineException
public 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