Class WorkItem

    • Field Detail

      • KEY_TYPE

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      • WorkItem

        public WorkItem()
    • Method Detail

      • 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'.
      • 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.
      • 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.
      • 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.
      • 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.
      • 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.
      • 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.
      • 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'.
      • 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.
      • 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.