Class WorkItem

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,Object>
com.xwiki.projectmanagement.model.WorkItem
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>

public class WorkItem extends HashMap<String,Object>
Describes an issue, a ticket, work package or some item coming from a project management tool.
Since:
1.0
Version:
$Id$
See Also:
  • Field Details

    • KEY_TYPE

      public static final String KEY_TYPE
      The key identifying the type property of the work item.
      See Also:
    • KEY_IDENTIFIER

      public static final String KEY_IDENTIFIER
      The key identifying the identifier property of the work item.
      See Also:
    • KEY_SUMMARY

      public static final String KEY_SUMMARY
      The key identifying the summary property of the work item.
      See Also:
    • KEY_DESCRIPTION

      public static final String KEY_DESCRIPTION
      The key identifying the description property of the work item.
      See Also:
    • KEY_START_DATE

      public static final String KEY_START_DATE
      The key identifying the startDate property of the work item.
      See Also:
    • KEY_DUE_DATE

      public static final String KEY_DUE_DATE
      The key identifying the dueDate property of the work item.
      See Also:
    • KEY_PROGRESS

      public static final String KEY_PROGRESS
      The key identifying the progress property of the work item.
      See Also:
    • KEY_CREATION_DATE

      public static final String KEY_CREATION_DATE
      The key identifying the creationDate property of the work item.
      See Also:
    • KEY_UPDATE_DATE

      public static final String KEY_UPDATE_DATE
      The key identifying the updateDate property of the work item.
      See Also:
    • KEY_CREATOR

      public static final String KEY_CREATOR
      The key identifying the creator property of the work item.
      See Also:
    • KEY_ASSIGNEES

      public static final String KEY_ASSIGNEES
      The key identifying the assignees property of the work item.
      See Also:
    • KEY_PRIORITY

      public static final String KEY_PRIORITY
      The key identifying the priority property of the work item.
      See Also:
    • KEY_PROJECT

      public static final String KEY_PROJECT
      The key identifying the project property of the work item.
      See Also:
    • KEY_STATUS

      public static final String KEY_STATUS
      The key identifying the status property of the work item.
      See Also:
    • KEY_REPORTER

      public static final String KEY_REPORTER
      The key identifying the reporter property of the work item.
      See Also:
    • KEY_RESOLUTION

      public static final String KEY_RESOLUTION
      The key identifying the resolution property of the work item.
      See Also:
    • KEY_RESOLVED

      public static final String KEY_RESOLVED
      The key identifying the resolved property of the work item.
      See Also:
    • KEY_LABELS

      public static final String KEY_LABELS
      The key identifying the labels property of the work item.
      See Also:
    • KEY_CLOSE_DATE

      public static final String KEY_CLOSE_DATE
      The key identifying the closeDate property of the work item.
      See Also:
    • KEY_MILESTONES

      public static final String KEY_MILESTONES
      The key identifying the milestones property of the work item.
      See Also:
    • KEY_CLOSED_BY

      public static final String KEY_CLOSED_BY
      The key identifying the closedBy property of the work item.
      See Also:
  • Constructor Details

    • WorkItem

      public WorkItem()
  • Method Details

    • getType

      public String getType()
      Returns:
      the type of the work item. i.e. task, bug, epic, etc.
    • setType

      public void setType(String type)
      Parameters:
      type - see getType().
    • getIdentifier

      public Linkable getIdentifier()
      Returns:
      the identifier for this work item together with a link to its location. For example, Open project and GitHub identify work packages numerically: '1001', Jira using a key: 'XWIKI-1001'.
    • setIdentifier

      public void setIdentifier(Linkable identifier)
      Parameters:
      identifier - see getIdentifier().
    • getSummary

      public Linkable getSummary()
      Returns:
      a text summarizing this work item together with a link to its location. On some platform, this property translates to the issue title.
    • setSummary

      public void setSummary(Linkable summary)
      Parameters:
      summary - see getSummary().
    • getDescription

      public String getDescription()
      Returns:
      a text that describes this work item.
    • setDescription

      public void setDescription(String description)
      Parameters:
      description - see getDescription().
    • getStartDate

      public Date getStartDate()
      Returns:
      the date when this work item was marked, by some user/entity, as started.
    • setStartDate

      public void setStartDate(Date startDate)
      Parameters:
      startDate - see getStartDate().
    • getDueDate

      public Date getDueDate()
      Returns:
      the date when this work item is expected to be finished, set as resolved.
    • setDueDate

      public void setDueDate(Date dueDate)
      Parameters:
      dueDate - see getDueDate().
    • getProgress

      public Integer getProgress()
      Returns:
      the progress, as a percentage, that has been done for this work item.
    • setProgress

      public void setProgress(Integer progress)
      Parameters:
      progress - see getProgress().
    • getCreationDate

      public Date getCreationDate()
      Returns:
      the date when this work item was created.
    • setCreationDate

      public void setCreationDate(Date creationDate)
      Parameters:
      creationDate - see getCreationDate().
    • getUpdateDate

      public Date getUpdateDate()
      Returns:
      the last date when this work item was updated or modified.
    • setUpdateDate

      public void setUpdateDate(Date updateDate)
      Parameters:
      updateDate - see getUpdateDate().
    • getCreator

      public Linkable getCreator()
      Returns:
      a tuple identifying the creator of this work item. The tuple contains the display name of the user and a link to their profile location.
    • setCreator

      public void setCreator(Linkable creator)
      Parameters:
      creator - see getCreator().
    • getAssignees

      public List<Linkable> getAssignees()
      Returns:
      a list of users assigned to this work item. Each user is a tuple containing the display name and the location to their profile location.
    • setAssignees

      public void setAssignees(List<Linkable> assignees)
      Parameters:
      assignees - see getAssignees().
    • getPriority

      public String getPriority()
      Returns:
      the priority that was assigned to this work item. i.e. "minor", "critical", "major", etc.
    • setPriority

      public void setPriority(String priority)
      Parameters:
      priority - see getPriority().
    • getProject

      public Linkable getProject()
      Returns:
      a tuple identifying the project where this work item belongs. The tuple contains the display name of the project and a link to its location.
    • setProject

      public void setProject(Linkable project)
      Parameters:
      project - see getProject().
    • getStatus

      public String getStatus()
      Returns:
      the current status of this work item.
    • setStatus

      public void setStatus(String status)
      Parameters:
      status - see getStatus().
    • getReporter

      public Linkable getReporter()
      Returns:
      a tuple representing the user thanks to whom this work item was created. If this work item represents a bug, it could be that somebody reported it and someone else created the ticket.
    • setReporter

      public void setReporter(Linkable reporter)
      Parameters:
      reporter - see getReporter().
    • getResolution

      public String getResolution()
      Returns:
      the resolution for this work item. A work item can be marked as resolved but it might need additional information on how it was closed. i.e. "duplicate", "won't resolve", "canceled" etc.
    • setResolution

      public void setResolution(String resolution)
      Parameters:
      resolution - see getResolution().
    • isResolved

      public boolean isResolved()
      Returns:
      denotes whether this work item is closed/resolved or not.
    • setResolved

      public void setResolved(boolean resolved)
      Parameters:
      resolved - see isResolved().
    • getLabels

      public List<String> getLabels()
      Returns:
      a list of labels that were assigned to this work item.
    • setLabels

      public void setLabels(List<String> labels)
      Parameters:
      labels - see getLabels().
    • getCloseDate

      public Date getCloseDate()
      Returns:
      the date when this work item was marked as closed.
    • setCloseDate

      public void setCloseDate(Date closeDate)
      Parameters:
      closeDate - see getCloseDate().
    • getMilestones

      public Linkable getMilestones()
      Returns:
      a tuple identifying the milestone that was associated to this work item. i.e. on Github one can associate a closed issue to a software milestone, in the case of Jira, an issue can have a 'fix version'.
    • setMilestones

      public void setMilestones(Linkable milestones)
      Parameters:
      milestones - see getMilestones().
    • getClosedBy

      public Linkable getClosedBy()
      Returns:
      a tuple that identifies the user that closed this work item. The user is identified through their display name and a link to the location of their profile.
    • setClosedBy

      public void setClosedBy(Linkable closedBy)
      Parameters:
      closedBy - see getClosedBy().
    • getMapEntries

      public Map<String,Object> getMapEntries()
      Returns:
      the map.
    • putEntry

      public void putEntry(String key, Object value)
      Parameters:
      key - the key.
      value - the value.
    • getLinkable

      public Map<String,Object> getLinkable(String key)
      Utility method that retrieves a linkable property.
      Parameters:
      key - the key of the linkable property. i.e. identifier, summary.
      Returns:
      the linkable property as a map or an empty map if nothing was found.
    • getLinkableValue

      public String getLinkableValue(String key)
      Utility method that retrieves the value of a linkable property.
      Parameters:
      key - the key of the linkable property. i.e. identifier, summary.
      Returns:
      the value of the linkable property or null if the linkable property does not exist.
    • getLinkableLocation

      public String getLinkableLocation(String key)
      Utility method that retrieves the location of a linkable property.
      Parameters:
      key - the key of the linkable property. i.e. identifier, summary.
      Returns:
      the location of the linkable property or null if the linkable property does not exist.