Class TaskImpl

java.lang.Object
pw.chew.clickup4j.internal.entities.TaskImpl
All Implemented Interfaces:
Task

public class TaskImpl extends Object implements Task
  • Constructor Details

    • TaskImpl

      public TaskImpl(org.json.JSONObject data, ClickUp4j clickUp4j)
  • Method Details

    • getId

      @NotNull public @NotNull String getId()
      Description copied from interface: Task
      The unique ID of this task.

      All IDs are unique on ClickUp, so this can safely be used as a primary key.

      Specified by:
      getId in interface Task
      Returns:
      the ID of this task
    • getCustomId

      @Nullable public @Nullable String getCustomId()
      Description copied from interface: Task
      The custom ID for this task.

      This feature is exclusive to the Business plan or above, so this is likely to be null.

      Specified by:
      getCustomId in interface Task
      Returns:
      A possibly null custom ID for this task
    • getName

      @NotNull public @NotNull String getName()
      Description copied from interface: Task
      The name of this task. This is also referred to as the title.
      Specified by:
      getName in interface Task
      Returns:
      the name of this task
    • getTextContent

      public String getTextContent()
      Description copied from interface: Task
      Returns the text content of this task.
      The API seems to return the same as Task.getDescription().
      Specified by:
      getTextContent in interface Task
      Returns:
      the description of this task
      See Also:
    • getDescription

      public String getDescription()
      Description copied from interface: Task
      Returns the complete description of this task.
      Specified by:
      getDescription in interface Task
      Returns:
      the description of this task
    • getStatus

      @NotNull public @NotNull Task.Status getStatus()
      Description copied from interface: Task
      Returns the status of this task.
      Specified by:
      getStatus in interface Task
      Returns:
      the status of this task
    • getOrderIndex

      public String getOrderIndex()
      Description copied from interface: Task
      Returns the order index of this task.
      The higher the index, the lower (vertically) the task will be.
      Specified by:
      getOrderIndex in interface Task
      Returns:
      the order index of this task
    • getDateCreated

      @NotNull public @NotNull OffsetDateTime getDateCreated()
      Description copied from interface: Task
      Returns when this Task was created.
      If this task was imported, it may show up as a date prior to ClickUp's creation date. Pretty neat!
      Specified by:
      getDateCreated in interface Task
      Returns:
      the date this task was created
    • getDateUpdated

      @NotNull public @NotNull OffsetDateTime getDateUpdated()
      Description copied from interface: Task
      Returns when this Task was last modified.
      Specified by:
      getDateUpdated in interface Task
      Returns:
      the date this task was last modified
    • getDateClosed

      public OffsetDateTime getDateClosed()
      Description copied from interface: Task
      Returns when this Task was closed.
      If the task is not closed, this will be null.
      Specified by:
      getDateClosed in interface Task
      Returns:
      the date this task was closed, or null if it is not closed
    • getCreator

      public User getCreator()
      Description copied from interface: Task
      Returns the user who created this task.
      Specified by:
      getCreator in interface Task
      Returns:
      the user who created this task
    • getAssignees

      @NotNull public @NotNull List<User> getAssignees()
      Description copied from interface: Task
      Returns a list of users who are assigned to work on this task.
      If the space doesn't have Space.isMultipleAssignees() enabled, this will return a list of one user.
      Specified by:
      getAssignees in interface Task
      Returns:
      a list of users assigned to work on this task
    • getWatchers

      @NotNull public @NotNull List<User> getWatchers()
      Description copied from interface: Task
      Returns the watchers for this task. This list will be empty if this task was retrieved from ClickUp4j.retrieveTasks(String), but will show up if this task was retrieved from ClickUp4j.retrieveTask(String).
      Specified by:
      getWatchers in interface Task
      Returns:
      the watchers for this task
    • getChecklists

      @NotNull public @NotNull List<Checklist> getChecklists()
      Description copied from interface: Task
      Returns a list of checklists associated with this task.
      This list will be empty if this task has no checklists.
      Specified by:
      getChecklists in interface Task
      Returns:
      a list of checklists associated with this task
    • getParentId

      @Nullable public @Nullable String getParentId()
      Description copied from interface: Task
      Retrieves the parent ID of this task.

      This will be null if this task is a top-level task.
      To get the parent task, use Task.retrieveParent().

      Specified by:
      getParentId in interface Task
      Returns:
      the parent ID of this task
    • retrieveParent

      public Requester<Task> retrieveParent()
      Description copied from interface: Task
      Retrieves the parent task of this task.

      This will be null if this task is a top-level task.

      Specified by:
      retrieveParent in interface Task
      Returns:
      a requester to get the parent task
    • getPriority

      @NotNull public @NotNull Task.Priority getPriority()
      Description copied from interface: Task
      The priority of this task. If there is no priority set, this will return Task.Priority.NONE.
      Specified by:
      getPriority in interface Task
      Returns:
      the never-null priority of this task
    • getDueDate

      @Nullable public @Nullable OffsetDateTime getDueDate()
      Description copied from interface: Task
      Returns the due date of this task, if there is one.
      If there is no due date, this will return null.
      Specified by:
      getDueDate in interface Task
      Returns:
      the possibly-null due date of this task
    • getStartDate

      @Nullable public @Nullable OffsetDateTime getStartDate()
      Description copied from interface: Task
      Returns the start date of this task, if there is one.
      If there is no start date, this will return null.
      Specified by:
      getStartDate in interface Task
      Returns:
      the possibly-null start date of this task
    • getTimeEstimate

      public Duration getTimeEstimate()
      Description copied from interface: Task
      Returns the estimated time to complete this task.
      Specified by:
      getTimeEstimate in interface Task
      Returns:
      the estimated time to complete this task
    • getTimeSpent

      public Duration getTimeSpent()
      Description copied from interface: Task
      Returns the time tracked to this task.
      This requires the space to have the Time Tracking ClickApp enabled.
      Specified by:
      getTimeSpent in interface Task
      Returns:
      the time spent on this task
    • getCustomFields

      @NotNull public @NotNull List<ICustomField> getCustomFields()
      Description copied from interface: Task
      Returns all the custom fields for this task.
      Custom Fields may not have a value set.
      Specified by:
      getCustomFields in interface Task
      Returns:
      all the custom fields for this task
    • getListId

      public String getListId()
      Specified by:
      getListId in interface Task
    • getFolderId

      public String getFolderId()
      Specified by:
      getFolderId in interface Task
    • getSpaceId

      public String getSpaceId()
      Specified by:
      getSpaceId in interface Task
    • retrieveSpace

      public Requester<Space> retrieveSpace()
      Specified by:
      retrieveSpace in interface Task
    • uploadAttachment

      public Requester<Attachment> uploadAttachment(File file, String filename)
      Description copied from interface: Task
      Uploads the specified File to this task.
      Specified by:
      uploadAttachment in interface Task
      Parameters:
      file - the file to upload
      filename - the name of the file
      Returns:
      a requester to upload an attachment to this task
    • getUrl

      @NotNull public @NotNull String getUrl()
      Description copied from interface: Task
      The URL link to this task.
      Specified by:
      getUrl in interface Task
      Returns:
      the URL link to this task
    • getManager

      @NotNull public @NotNull TaskManager getManager()
      Description copied from interface: Task
      Return the manager of this task.
      This is used to modify the task.
      Specified by:
      getManager in interface Task
      Returns:
      the manager of this task
    • resolve

      public Requester<Task> resolve()
      Description copied from interface: Task
      Resolves missing fields in this task.
      Due to API limitations, this excludes custom field values.
      Specified by:
      resolve in interface Task
      Returns:
      this task with all missing fields resolved
    • delete

      public Requester<Void> delete()
      Description copied from interface: Task
      Deletes this task.
      Specified by:
      delete in interface Task
      Returns:
      a requester to delete this task