Interface TaskService


public interface TaskService
Provide services for manipulating the content's tasks. Note that for retrieving tasks you have to use the StateService
Since:
1.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    assignTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId, String assignee, String comment)
    Assigns the given task
    assignTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId, String assignee, String comment, Date dueDate)
    Assigns the given task
    completeTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId, String comment)
    Completes the given task.
    completeTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId, String outcome, String comment)
    Deprecated.
    createTask(com.atlassian.confluence.core.ContentEntityObject content, String taskName, String assignee, String comment)
    Create a task on the content in the current State.
    createTask(com.atlassian.confluence.core.ContentEntityObject content, String taskName, String assignee, String comment, Date dueDate)
    Create a task on the content in the current State.
    editTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId, String newTaskName, String newComment, Date dueDate)
    Edits a currently existing task.
    getActiveTasks(com.atlassian.confluence.core.ContentEntityObject ceo)
    Returns a list of tasks which are currently active on the given content object.
    getCompletedTasks(com.atlassian.confluence.core.ContentEntityObject ceo)
    Returns a list of tasks which are completed on the given content object.
    getTasks(com.atlassian.confluence.core.ContentEntityObject ceo)
    Returns all tasks which are on the given content object.
    void
    removeTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId)
    Removes a given task
    void
    removeTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId, String comment)
    Removes a given task
  • Method Details

    • createTask

      Task createTask(com.atlassian.confluence.core.ContentEntityObject content, String taskName, String assignee, String comment, Date dueDate) throws WorkflowException
      Create a task on the content in the current State. The task may be assigned to a user
      Parameters:
      content - the content object
      taskName - the name of the task
      assignee - the name of the assignee (optional)
      comment - a comment of description of the task
      dueDate - the due date for this task. (alpha functionality, not yet supported)
      Returns:
      the Task created
      Throws:
      WorkflowException
      Since:
      1.3
    • createTask

      Task createTask(com.atlassian.confluence.core.ContentEntityObject content, String taskName, String assignee, String comment) throws WorkflowException
      Create a task on the content in the current State. The task may be assigned to a user.
      Parameters:
      content - the content object
      taskName - the name of the task
      assignee - the name of the assignee (optional)
      comment - a comment of description of the task
      Returns:
      the Task created
      Throws:
      WorkflowException
      Since:
      1.0
    • editTask

      Task editTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId, String newTaskName, String newComment, Date dueDate) throws WorkflowException
      Edits a currently existing task. This method works as a PUT operation where if no data is provided for a field and it had already a value then it will be removed.
      Parameters:
      content - the content object
      taskId - the id of the task to edit
      newTaskName - the new name of the task
      newComment - the new comment for the task
      dueDate - the new due date for the task (alpha functionality, not yet supported)
      Returns:
      the updated Task object
      Throws:
      WorkflowException
      Since:
      1.3
    • completeTask

      @Deprecated Task completeTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId, String outcome, String comment) throws WorkflowException
      Deprecated.
      Completes the given task.
      Parameters:
      content - the content object
      taskId - the id of the task to complete
      outcome - the outcome of the task. User approved or rejected for Approval-type tasks
      comment - a comment associated with the completion
      Returns:
      the task containing the new completion
      Throws:
      WorkflowException
      Since:
      1.0
    • completeTask

      Task completeTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId, String comment) throws WorkflowException
      Completes the given task.
      Parameters:
      content - the content object
      taskId - the id of the task to complete
      comment - a comment associated with the completion
      Returns:
      the task containing the new completion
      Throws:
      WorkflowException
      Since:
      6.17.3
    • removeTask

      void removeTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId) throws WorkflowException
      Removes a given task
      Parameters:
      content - the content object
      taskId - the id of the task to remove
      Throws:
      WorkflowException
      Since:
      1.1
    • removeTask

      void removeTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId, String comment) throws WorkflowException
      Removes a given task
      Parameters:
      content - the content object
      taskId - the id of the task to remove
      comment - the comment associated with the deletion
      Throws:
      WorkflowException
      Since:
      1.11.1
    • assignTask

      Task assignTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId, String assignee, String comment) throws WorkflowException
      Assigns the given task
      Parameters:
      content - the content object
      taskId - the id of the task (in the current state)
      assignee - the name of the assignee
      comment - the comment associated to this assignment
      Returns:
      the task containing the new assignment
      Throws:
      WorkflowException
      Since:
      1.0
    • assignTask

      Task assignTask(com.atlassian.confluence.core.ContentEntityObject content, String taskId, String assignee, String comment, Date dueDate) throws WorkflowException
      Assigns the given task
      Parameters:
      content - the content object
      taskId - the id of the task (in the current state)
      assignee - the name of the assignee
      comment - the comment associated to this assignment
      dueDate - the due date for this task
      Returns:
      the task containing the new assignment
      Throws:
      WorkflowException
      Since:
      1.3
    • getTasks

      List<ContentTask> getTasks(com.atlassian.confluence.core.ContentEntityObject ceo)
      Returns all tasks which are on the given content object.
      Parameters:
      ceo - the Content object to return the tasks for.
      Returns:
      list of tasks, empty list if none.
    • getActiveTasks

      List<ContentTask> getActiveTasks(com.atlassian.confluence.core.ContentEntityObject ceo)
      Returns a list of tasks which are currently active on the given content object.
      Parameters:
      ceo - the content object to return the active tasks for.
      Returns:
      list of active tasks, empty list if none.
    • getCompletedTasks

      List<ContentTask> getCompletedTasks(com.atlassian.confluence.core.ContentEntityObject ceo)
      Returns a list of tasks which are completed on the given content object.
      Parameters:
      ceo - the content object to returne the completed tasks for.
      Returns:
      list of compelted tasks, empty if none.