Package com.taskadapter.redmineapi.bean
Class Issue
- java.lang.Object
-
- com.taskadapter.redmineapi.bean.Issue
-
- All Implemented Interfaces:
Identifiable
public class Issue extends java.lang.Object implements Identifiable
Redmine's Issue.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));
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description Issue()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addAttachment(Attachment attachment)
void
addAttachments(java.util.Collection<Attachment> collection)
void
addChangesets(java.util.Collection<Changeset> changesets)
void
addChildren(java.util.Collection<Issue> children)
void
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.void
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.void
addRelations(java.util.Collection<IssueRelation> collection)
void
addWatchers(java.util.Collection<Watcher> watchers)
void
clearCustomFields()
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 groupsjava.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()
void
setAssigneeId(java.lang.Integer assigneeId)
void
setAssigneeName(java.lang.String assigneeName)
void
setAuthorId(java.lang.Integer id)
void
setAuthorName(java.lang.String name)
void
setCategory(IssueCategory category)
void
setClosedOn(java.util.Date closedOn)
void
setCreatedOn(java.util.Date createdOn)
void
setDescription(java.lang.String description)
void
setDoneRatio(java.lang.Integer doneRatio)
void
setDueDate(java.util.Date dueDate)
void
setEstimatedHours(java.lang.Float estimatedTime)
void
setNotes(java.lang.String notes)
void
setParentId(java.lang.Integer parentId)
void
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.void
setPrivateIssue(boolean privateIssue)
void
setPrivateNotes(boolean privateNotes)
void
setProjectId(java.lang.Integer projectId)
void
setProjectName(java.lang.String name)
void
setSpentHours(java.lang.Float spentHours)
void
setStartDate(java.util.Date startDate)
void
setStatusId(java.lang.Integer statusId)
void
setStatusName(java.lang.String statusName)
void
setSubject(java.lang.String subject)
void
setTargetVersion(Version version)
void
setTracker(Tracker tracker)
void
setUpdatedOn(java.util.Date updatedOn)
java.lang.String
toString()
-
-
-
Field Detail
-
DATABASE_ID
public static final Property<java.lang.Integer> DATABASE_ID
-
SUBJECT
public static final Property<java.lang.String> SUBJECT
-
START_DATE
public static final Property<java.util.Date> START_DATE
-
DUE_DATE
public static final Property<java.util.Date> DUE_DATE
-
CREATED_ON
public static final Property<java.util.Date> CREATED_ON
-
UPDATED_ON
public static final Property<java.util.Date> UPDATED_ON
-
DONE_RATIO
public static final Property<java.lang.Integer> DONE_RATIO
-
PARENT_ID
public static final Property<java.lang.Integer> PARENT_ID
-
PRIORITY_ID
public static final Property<java.lang.Integer> PRIORITY_ID
-
ESTIMATED_HOURS
public static final Property<java.lang.Float> ESTIMATED_HOURS
-
SPENT_HOURS
public static final Property<java.lang.Float> SPENT_HOURS
-
ASSIGNEE_ID
public static final Property<java.lang.Integer> ASSIGNEE_ID
-
ASSIGNEE_NAME
public static final Property<java.lang.String> ASSIGNEE_NAME
-
NOTES
public static final Property<java.lang.String> NOTES
Some comment describing an issue update.
-
PRIVATE_NOTES
public static final Property<java.lang.Boolean> PRIVATE_NOTES
-
PRIORITY_TEXT
public static final Property<java.lang.String> PRIORITY_TEXT
-
PROJECT_ID
public static final Property<java.lang.Integer> PROJECT_ID
-
PROJECT_NAME
public static final Property<java.lang.String> PROJECT_NAME
-
AUTHOR_ID
public static final Property<java.lang.Integer> AUTHOR_ID
-
AUTHOR_NAME
public static final Property<java.lang.String> AUTHOR_NAME
-
DESCRIPTION
public static final Property<java.lang.String> DESCRIPTION
-
CLOSED_ON
public static final Property<java.util.Date> CLOSED_ON
-
STATUS_ID
public static final Property<java.lang.Integer> STATUS_ID
-
STATUS_NAME
public static final Property<java.lang.String> STATUS_NAME
-
ISSUE_CATEGORY
public static final Property<IssueCategory> ISSUE_CATEGORY
-
PRIVATE_ISSUE
public static final Property<java.lang.Boolean> PRIVATE_ISSUE
-
CUSTOM_FIELDS
public static final 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.
-
RELATIONS
public static final Property<java.util.Set<IssueRelation>> RELATIONS
-
ATTACHMENTS
public static final Property<java.util.Set<Attachment>> ATTACHMENTS
-
-
Method Detail
-
getProjectId
public java.lang.Integer getProjectId()
-
setProjectId
public void setProjectId(java.lang.Integer projectId)
-
getProjectName
public java.lang.String getProjectName()
-
setProjectName
public void setProjectName(java.lang.String name)
-
getDoneRatio
public java.lang.Integer getDoneRatio()
-
setDoneRatio
public void setDoneRatio(java.lang.Integer doneRatio)
-
getPriorityText
public java.lang.String getPriorityText()
-
setPriorityText
public 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.
-
getAssigneeId
public java.lang.Integer getAssigneeId()
Redmine can be configured to allow group assignments for issues: Configuration option: Settings -> Issue Tracking -> Allow issue assignment to groupsAn assignee can be a user or a group
-
setAssigneeId
public void setAssigneeId(java.lang.Integer assigneeId)
-
getAssigneeName
public java.lang.String getAssigneeName()
-
setAssigneeName
public void setAssigneeName(java.lang.String assigneeName)
-
getEstimatedHours
public java.lang.Float getEstimatedHours()
-
setEstimatedHours
public void setEstimatedHours(java.lang.Float estimatedTime)
-
getSpentHours
public java.lang.Float getSpentHours()
-
setSpentHours
public void setSpentHours(java.lang.Float spentHours)
-
getParentId
public java.lang.Integer getParentId()
Parent Issue ID, or NULL for issues without a parent.- Returns:
- NULL, if there's no parent
-
setParentId
public void setParentId(java.lang.Integer parentId)
-
getId
public java.lang.Integer getId()
- Specified by:
getId
in interfaceIdentifiable
- Returns:
- database id for this object. can be NULL for Issues not added to Redmine yet
-
getSubject
public java.lang.String getSubject()
-
setSubject
public void setSubject(java.lang.String subject)
-
getStartDate
public java.util.Date getStartDate()
-
setStartDate
public void setStartDate(java.util.Date startDate)
-
getDueDate
public java.util.Date getDueDate()
-
setDueDate
public void setDueDate(java.util.Date dueDate)
-
getAuthorId
public java.lang.Integer getAuthorId()
-
setAuthorId
public void setAuthorId(java.lang.Integer id)
-
getAuthorName
public java.lang.String getAuthorName()
-
setAuthorName
public void setAuthorName(java.lang.String name)
-
getTracker
public Tracker getTracker()
-
setTracker
public void setTracker(Tracker tracker)
-
getDescription
public java.lang.String getDescription()
-
setDescription
public void setDescription(java.lang.String description)
-
getCreatedOn
public java.util.Date getCreatedOn()
-
setCreatedOn
public void setCreatedOn(java.util.Date createdOn)
-
getUpdatedOn
public java.util.Date getUpdatedOn()
-
setUpdatedOn
public void setUpdatedOn(java.util.Date updatedOn)
-
getClosedOn
public java.util.Date getClosedOn()
-
setClosedOn
public void setClosedOn(java.util.Date closedOn)
-
getStatusId
public java.lang.Integer getStatusId()
-
setStatusId
public void setStatusId(java.lang.Integer statusId)
-
getStatusName
public java.lang.String getStatusName()
-
setStatusName
public void setStatusName(java.lang.String statusName)
-
getCustomFields
public java.util.Collection<CustomField> getCustomFields()
- Returns:
- unmodifiable collection of Custom Field objects. the collection may be empty, but it is never NULL.
-
clearCustomFields
public void clearCustomFields()
-
addCustomFields
public void addCustomFields(java.util.Collection<CustomField> customFields)
NOTE: The custom field(s) must have correct database ID set to be saved to Redmine. This is Redmine REST API's limitation.
-
addCustomField
public void 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.- Parameters:
customField
- the field to add to the issue.
-
getNotes
@Deprecated public java.lang.String getNotes()
Deprecated.
-
setNotes
public void setNotes(java.lang.String notes)
- Parameters:
notes
- Some comment describing the issue update
-
isPrivateNotes
public boolean isPrivateNotes()
-
setPrivateNotes
public void setPrivateNotes(boolean privateNotes)
- Parameters:
privateNotes
- mark note as private
-
getJournals
public java.util.Collection<Journal> getJournals()
Don't forget to use Include.journals flag when loading issue from Redmine server:Issue issue = issueManager.getIssueById(3205, Include.journals);
- Returns:
- unmodifiable collection of Journal entries or empty collection if no objects found. Never NULL.
- See Also:
Include.journals
-
addJournals
public void addJournals(java.util.Collection<Journal> journals)
Issue journals are created automatically when you update existing issues. journal entries are essentially log records for changes you make. you cannot just add log records without making actual changes. this API method is misleading and it should only be used internally by Redmine Json parser when parsing response from server. we should hide it from public. TODO hide this method. https://github.com/taskadapter/redmine-java-api/issues/199
-
getChangesets
public java.util.Collection<Changeset> getChangesets()
Don't forget to use Include.changesets flag when loading issue from Redmine server:Issue issue = issueManager.getIssueById(3205, Include.changesets);
- Returns:
- unmodifiable collection of entries or empty collection if no objects found.
- See Also:
Include.changesets
-
addChangesets
public void addChangesets(java.util.Collection<Changeset> changesets)
-
getWatchers
public java.util.Collection<Watcher> getWatchers()
Don't forget to use Include.watchers flag when loading issue from Redmine server:Issue issue = issueManager.getIssueById(3205, Include.watchers);
- Returns:
- unmodifiable collection of entries or empty collection if no objects found.
- See Also:
Include.watchers
-
addWatchers
public void addWatchers(java.util.Collection<Watcher> watchers)
-
getChildren
public java.util.Collection<Issue> getChildren()
Don't forget to use Include.children flag when loading issue from Redmine server:Issue issue = issueManager.getIssueById(3205, Include.children);
- Returns:
- Collection of entries or empty collection if no objects found.
- See Also:
Include.children
-
addChildren
public void addChildren(java.util.Collection<Issue> children)
-
equals
public boolean equals(java.lang.Object o)
Issues are considered equal if their IDs are equal. what about two issues with null ids?- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getCustomFieldById
public CustomField getCustomFieldById(int customFieldId)
- Returns:
- the custom field with given Id or NULL if the field is not found
-
getCustomFieldByName
public CustomField getCustomFieldByName(java.lang.String customFieldName)
- Returns:
- the custom field with given name or NULL if the field is not found
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getRelations
public java.util.Collection<IssueRelation> getRelations()
Relations are only loaded if you include Include.relations when loading the Issue.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));
- Returns:
- unmodifiable collection of Relations or EMPTY collection if none found. Never returns NULL.
- See Also:
Include.relations
-
addRelations
public void addRelations(java.util.Collection<IssueRelation> collection)
-
getPriorityId
public java.lang.Integer getPriorityId()
-
setPriorityId
public void setPriorityId(java.lang.Integer priorityId)
-
getTargetVersion
public Version getTargetVersion()
-
getAttachments
public java.util.Collection<Attachment> getAttachments()
Don't forget to use Include.attachments flag when loading issue from Redmine server:Issue issue = issueManager.getIssueById(3205, Include.attachments);
- Returns:
- unmodifiable collection of entries or empty collection if no objects found.
- See Also:
Include.attachments
-
addAttachments
public void addAttachments(java.util.Collection<Attachment> collection)
-
addAttachment
public void addAttachment(Attachment attachment)
-
setTargetVersion
public void setTargetVersion(Version version)
-
getCategory
public IssueCategory getCategory()
-
setCategory
public void setCategory(IssueCategory category)
-
isPrivateIssue
public boolean isPrivateIssue()
Default value is not determines. it's up to the server what it thinks the default value is if not set.
-
setPrivateIssue
public void setPrivateIssue(boolean privateIssue)
-
getStorage
public PropertyStorage getStorage()
-
-