public class Issue extends java.lang.Object implements Identifiable, FluentStyle
Note that methods returning lists of elements (like getRelations(), getWatchers(), etc return unmodifiable collections. You need to use methods like addRelations() if you want to add elements, e.g.:
issue.addRelations(Collections.singletonList(relation));
Modifier and Type | Field and Description |
---|---|
static Property<java.lang.Integer> |
ASSIGNEE_ID |
static Property<java.lang.String> |
ASSIGNEE_NAME |
static Property<java.util.Set<Attachment>> |
ATTACHMENTS |
static Property<java.lang.Integer> |
AUTHOR_ID |
static Property<java.lang.String> |
AUTHOR_NAME |
static Property<java.util.Set<Changeset>> |
CHANGESETS |
static Property<java.util.Set<Issue>> |
CHILDREN |
static Property<java.util.Date> |
CLOSED_ON |
static Property<java.util.Date> |
CREATED_ON |
static Property<java.util.Set<CustomField>> |
CUSTOM_FIELDS
can't have two custom fields with the same ID in the collection, that's why it is declared
as a Set, not a List.
|
static Property<java.lang.Integer> |
DATABASE_ID |
static Property<java.lang.String> |
DESCRIPTION |
static Property<java.lang.Integer> |
DONE_RATIO |
static Property<java.util.Date> |
DUE_DATE |
static Property<java.lang.Float> |
ESTIMATED_HOURS |
static Property<IssueCategory> |
ISSUE_CATEGORY |
static Property<java.util.Set<Journal>> |
JOURNALS |
static Property<java.lang.String> |
NOTES
Some comment describing an issue update.
|
static Property<java.lang.Integer> |
PARENT_ID |
static Property<java.lang.Integer> |
PRIORITY_ID |
static Property<java.lang.String> |
PRIORITY_TEXT |
static Property<java.lang.Boolean> |
PRIVATE_ISSUE |
static Property<java.lang.Boolean> |
PRIVATE_NOTES |
static Property<java.lang.Integer> |
PROJECT_ID |
static Property<java.lang.String> |
PROJECT_NAME |
static Property<java.util.Set<IssueRelation>> |
RELATIONS |
static Property<java.lang.Float> |
SPENT_HOURS |
static Property<java.util.Date> |
START_DATE |
static Property<java.lang.Integer> |
STATUS_ID |
static Property<java.lang.String> |
STATUS_NAME |
static Property<java.lang.String> |
SUBJECT |
static Property<Version> |
TARGET_VERSION |
static Property<Tracker> |
TRACKER |
static Property<java.util.Date> |
UPDATED_ON |
static Property<java.util.Set<Watcher>> |
WATCHERS |
Constructor and Description |
---|
Issue() |
Issue(Transport transport,
int projectId)
Each Issue object must have project Id set in order for Redmine 3.x to accept it via REST API.
|
Issue(Transport transport,
int projectId,
java.lang.String subject) |
Modifier and Type | Method and Description |
---|---|
Issue |
addAttachment(Attachment attachment) |
Issue |
addAttachments(java.util.Collection<Attachment> collection) |
Issue |
addChangesets(java.util.Collection<Changeset> changesets) |
Issue |
addChildren(java.util.Collection<Issue> children) |
Issue |
addCustomField(CustomField customField)
If there is a custom field with the same ID already present in the Issue,
the new field replaces the old one.
|
Issue |
addCustomFields(java.util.Collection<CustomField> customFields)
NOTE: The custom field(s) must have correct database ID set to be saved to Redmine.
|
void |
addJournals(java.util.Collection<Journal> journals)
Issue journals are created automatically when you update existing issues.
|
Issue |
addRelations(java.util.Collection<IssueRelation> collection) |
void |
addWatcher(int watcherId) |
Issue |
addWatchers(java.util.Collection<Watcher> watchers) |
Issue |
clearCustomFields() |
Issue |
create() |
void |
delete() |
void |
deleteWatcher(int watcherId) |
boolean |
equals(java.lang.Object o)
Issues are considered equal if their IDs are equal.
|
java.lang.Integer |
getAssigneeId()
Redmine can be configured to allow group assignments for issues:
Configuration option: Settings -> Issue Tracking -> Allow issue assignment to groups
|
java.lang.String |
getAssigneeName() |
java.util.Collection<Attachment> |
getAttachments()
Don't forget to use Include.attachments flag when loading issue from Redmine server:
|
java.lang.Integer |
getAuthorId() |
java.lang.String |
getAuthorName() |
IssueCategory |
getCategory() |
java.util.Collection<Changeset> |
getChangesets()
Don't forget to use Include.changesets flag when loading issue from Redmine server:
|
java.util.Collection<Issue> |
getChildren()
Don't forget to use Include.children flag when loading issue from Redmine server:
|
java.util.Date |
getClosedOn() |
java.util.Date |
getCreatedOn() |
CustomField |
getCustomFieldById(int customFieldId) |
CustomField |
getCustomFieldByName(java.lang.String customFieldName) |
java.util.Collection<CustomField> |
getCustomFields() |
java.lang.String |
getDescription() |
java.lang.Integer |
getDoneRatio() |
java.util.Date |
getDueDate() |
java.lang.Float |
getEstimatedHours() |
java.lang.Integer |
getId() |
java.util.Collection<Journal> |
getJournals()
Don't forget to use Include.journals flag when loading issue from Redmine server:
|
java.lang.String |
getNotes()
Deprecated.
|
java.lang.Integer |
getParentId()
Parent Issue ID, or NULL for issues without a parent.
|
java.lang.Integer |
getPriorityId() |
java.lang.String |
getPriorityText() |
java.lang.Integer |
getProjectId() |
java.lang.String |
getProjectName() |
java.util.Collection<IssueRelation> |
getRelations()
Relations are only loaded if you include Include.relations when loading the Issue.
|
java.lang.Float |
getSpentHours() |
java.util.Date |
getStartDate() |
java.lang.Integer |
getStatusId() |
java.lang.String |
getStatusName() |
PropertyStorage |
getStorage() |
java.lang.String |
getSubject() |
Version |
getTargetVersion() |
Tracker |
getTracker() |
java.util.Date |
getUpdatedOn() |
java.util.Collection<Watcher> |
getWatchers()
Don't forget to use Include.watchers flag when loading issue from Redmine server:
|
int |
hashCode() |
boolean |
isPrivateIssue()
Default value is not determines.
|
boolean |
isPrivateNotes() |
Issue |
setAssigneeId(java.lang.Integer assigneeId) |
Issue |
setAssigneeName(java.lang.String assigneeName) |
Issue |
setAuthorId(java.lang.Integer id) |
Issue |
setAuthorName(java.lang.String name) |
Issue |
setCategory(IssueCategory category) |
Issue |
setClosedOn(java.util.Date closedOn) |
Issue |
setCreatedOn(java.util.Date createdOn) |
Issue |
setDescription(java.lang.String description) |
Issue |
setDoneRatio(java.lang.Integer doneRatio) |
Issue |
setDueDate(java.util.Date dueDate) |
Issue |
setEstimatedHours(java.lang.Float estimatedTime) |
Issue |
setId(java.lang.Integer id) |
Issue |
setNotes(java.lang.String notes) |
Issue |
setParentId(java.lang.Integer parentId) |
Issue |
setPriorityId(java.lang.Integer priorityId) |
void |
setPriorityText(java.lang.String priority)
Deprecated.
This method has no effect when creating issues on Redmine Server, so we might as well just delete it
in the future releases.
|
Issue |
setPrivateIssue(boolean privateIssue) |
Issue |
setPrivateNotes(boolean privateNotes) |
Issue |
setProjectId(java.lang.Integer projectId) |
Issue |
setProjectName(java.lang.String name) |
Issue |
setSpentHours(java.lang.Float spentHours) |
Issue |
setStartDate(java.util.Date startDate) |
Issue |
setStatusId(java.lang.Integer statusId) |
Issue |
setStatusName(java.lang.String statusName) |
Issue |
setSubject(java.lang.String subject) |
Issue |
setTargetVersion(Version version) |
Issue |
setTracker(Tracker tracker) |
void |
setTransport(Transport transport) |
Issue |
setUpdatedOn(java.util.Date updatedOn) |
java.lang.String |
toString() |
void |
update() |
public static final Property<java.lang.Integer> DATABASE_ID
public static final Property<java.lang.String> SUBJECT
public static final Property<java.util.Date> START_DATE
public static final Property<java.util.Date> DUE_DATE
public static final Property<java.util.Date> CREATED_ON
public static final Property<java.util.Date> UPDATED_ON
public static final Property<java.lang.Integer> DONE_RATIO
public static final Property<java.lang.Integer> PARENT_ID
public static final Property<java.lang.Integer> PRIORITY_ID
public static final Property<java.lang.Float> ESTIMATED_HOURS
public static final Property<java.lang.Float> SPENT_HOURS
public static final Property<java.lang.Integer> ASSIGNEE_ID
public static final Property<java.lang.String> ASSIGNEE_NAME
public static final Property<java.lang.String> NOTES
public static final Property<java.lang.Boolean> PRIVATE_NOTES
public static final Property<java.lang.String> PRIORITY_TEXT
public static final Property<java.lang.Integer> PROJECT_ID
public static final Property<java.lang.String> PROJECT_NAME
public static final Property<java.lang.Integer> AUTHOR_ID
public static final Property<java.lang.String> AUTHOR_NAME
public static final Property<java.lang.String> DESCRIPTION
public static final Property<java.util.Date> CLOSED_ON
public static final Property<java.lang.Integer> STATUS_ID
public static final Property<java.lang.String> STATUS_NAME
public static final Property<IssueCategory> ISSUE_CATEGORY
public static final Property<java.lang.Boolean> PRIVATE_ISSUE
public static final Property<java.util.Set<CustomField>> CUSTOM_FIELDS
public static final Property<java.util.Set<IssueRelation>> RELATIONS
public static final Property<java.util.Set<Attachment>> ATTACHMENTS
public Issue()
public Issue(Transport transport, int projectId)
public Issue(Transport transport, int projectId, java.lang.String subject)
projectId
- Each Issue object must have project Id set in order for Redmine 3.x to accept it via REST API.public java.lang.Integer getProjectId()
public Issue setProjectId(java.lang.Integer projectId)
public java.lang.String getProjectName()
public Issue setProjectName(java.lang.String name)
public Issue setId(java.lang.Integer id)
id
- database ID.public java.lang.Integer getDoneRatio()
public Issue setDoneRatio(java.lang.Integer doneRatio)
public java.lang.String getPriorityText()
public void setPriorityText(java.lang.String priority)
public java.lang.Integer getAssigneeId()
An assignee can be a user or a group
public Issue setAssigneeId(java.lang.Integer assigneeId)
public java.lang.String getAssigneeName()
public Issue setAssigneeName(java.lang.String assigneeName)
public java.lang.Float getEstimatedHours()
public Issue setEstimatedHours(java.lang.Float estimatedTime)
public java.lang.Float getSpentHours()
public Issue setSpentHours(java.lang.Float spentHours)
public java.lang.Integer getParentId()
public Issue setParentId(java.lang.Integer parentId)
public java.lang.Integer getId()
getId
in interface Identifiable
public java.lang.String getSubject()
public Issue setSubject(java.lang.String subject)
public java.util.Date getStartDate()
public Issue setStartDate(java.util.Date startDate)
public java.util.Date getDueDate()
public Issue setDueDate(java.util.Date dueDate)
public java.lang.Integer getAuthorId()
public Issue setAuthorId(java.lang.Integer id)
public java.lang.String getAuthorName()
public Issue setAuthorName(java.lang.String name)
public Tracker getTracker()
public java.lang.String getDescription()
public Issue setDescription(java.lang.String description)
public java.util.Date getCreatedOn()
public Issue setCreatedOn(java.util.Date createdOn)
public java.util.Date getUpdatedOn()
public Issue setUpdatedOn(java.util.Date updatedOn)
public java.util.Date getClosedOn()
public Issue setClosedOn(java.util.Date closedOn)
public java.lang.Integer getStatusId()
public Issue setStatusId(java.lang.Integer statusId)
public java.lang.String getStatusName()
public Issue setStatusName(java.lang.String statusName)
public java.util.Collection<CustomField> getCustomFields()
public Issue clearCustomFields()
public Issue addCustomFields(java.util.Collection<CustomField> customFields)
public Issue addCustomField(CustomField customField)
customField
- the field to add to the issue.@Deprecated public java.lang.String getNotes()
public Issue setNotes(java.lang.String notes)
notes
- Some comment describing the issue updatepublic boolean isPrivateNotes()
public Issue setPrivateNotes(boolean privateNotes)
privateNotes
- mark note as privatepublic java.util.Collection<Journal> getJournals()
Issue issue = issueManager.getIssueById(3205, Include.journals);
Include.journals
public void addJournals(java.util.Collection<Journal> journals)
public java.util.Collection<Changeset> getChangesets()
Issue issue = issueManager.getIssueById(3205, Include.changesets);
Include.changesets
public java.util.Collection<Watcher> getWatchers()
Issue issue = issueManager.getIssueById(3205, Include.watchers);
Include.watchers
public java.util.Collection<Issue> getChildren()
Issue issue = issueManager.getIssueById(3205, Include.children);
Include.children
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public CustomField getCustomFieldById(int customFieldId)
public CustomField getCustomFieldByName(java.lang.String customFieldName)
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Collection<IssueRelation> getRelations()
Issue issue = issueManager.getIssueById(3205, Include.relations);
Since the returned collection is not modifiable, you need to use addRelations() method if you want to add elements, e.g.:
issue.addRelations(Collections.singletonList(relation));
Include.relations
public Issue addRelations(java.util.Collection<IssueRelation> collection)
public java.lang.Integer getPriorityId()
public Issue setPriorityId(java.lang.Integer priorityId)
public Version getTargetVersion()
public java.util.Collection<Attachment> getAttachments()
Issue issue = issueManager.getIssueById(3205, Include.attachments);
Include.attachments
public Issue addAttachments(java.util.Collection<Attachment> collection)
public Issue addAttachment(Attachment attachment)
public IssueCategory getCategory()
public Issue setCategory(IssueCategory category)
public boolean isPrivateIssue()
public Issue setPrivateIssue(boolean privateIssue)
public PropertyStorage getStorage()
public Issue create() throws RedmineException
RedmineAuthenticationException
- invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.NotFoundException
- the required project is not foundRedmineException
public void update() throws RedmineException
RedmineException
public void delete() throws RedmineException
RedmineException
public void addWatcher(int watcherId) throws RedmineException
RedmineException
public void deleteWatcher(int watcherId) throws RedmineException
RedmineException
public void setTransport(Transport transport)
setTransport
in interface FluentStyle