class Projects::Api::TasksAPI

Public Class Methods

new(authToken,portalId) click to toggle source
  • Construct a new TasksAPI using User's authToken and portalId.

Parameters

  • authToken

    User's authToken.

  • portalId
    • User's portalId.

Calls superclass method Projects::Api::API::new
# File lib/projects/api/TasksAPI.rb, line 38
def initialize(authToken,portalId)
        super(authToken,portalId)
end

Public Instance Methods

addComment(projectId, taskId, content) click to toggle source
  • Add the task comment.

Parameters

  • projectId
    • ID of the project.

  • taskId
    • ID of the task.

  • content
    • Comment of the task

Returns

  • Returns the Comment object.

# File lib/projects/api/TasksAPI.rb, line 212
def addComment(projectId, taskId, content)

        url = getBaseURL+"projects/"+String(projectId)+"/tasks/"+String(taskId)+"/comments/"
        
        paramMap = Hash.new
        paramMap["content"] = content
        
        response = ZohoHTTPClient.post(url, getQueryMap, paramMap)
        
        return @taskParser.getComment(response)
        
end
create(projectId, task) click to toggle source
  • Create a new task for the project.

Parameters

  • projectId
    • ID of the project.

  • task
    • Task object.

Returns

  • Task object.

# File lib/projects/api/TasksAPI.rb, line 110
def create(projectId, task)
        url = getBaseURL+"projects/"+String(projectId)+"/tasks/"            
        response = ZohoHTTPClient.post(url, getQueryMap, task.toParamMAP)           
        return $taskParser.getTask(response)
end
delete(projectId, taskId) click to toggle source
  • Delete an existing task.

Parameters

  • projectId
    • ID of the project.

  • taskId
    • ID of the task.

Returns

  • String object.

# File lib/projects/api/TasksAPI.rb, line 146
def delete(projectId, taskId)
        url = getBaseURL+"projects/"+String(projectId)+"/tasks/"+String(taskId)+"/"         
        response = ZohoHTTPClient.delete(url, getQueryMap)
        return $taskParser.getResult(response)
end
deleteComment(projectId, taskId, commentId) click to toggle source
  • Delete an existing task comment.

Parameters

  • projectId
    • ID of the project.

  • taskId
    • ID of the task.

  • commentId
    • ID of the task Comment.

Returns

  • Returns the success message(Comment Deleted Successfully).

# File lib/projects/api/TasksAPI.rb, line 240
def deleteComment(projectId, taskId, commentId)

        url = getBaseURL+"projects/"+String(projectId)+"/tasks/"+String(taskId)+"/comments/"+String(commentId)+"/"
        
        response = ZohoHTTPClient.delete(url, getQueryMap)
        
        return @taskParser.getResult(response)
        
end
get(projectId, taskId) click to toggle source
  • Get the details of a task.

Parameters

  • projectId
    • ID of the project.

  • taskId
    • ID of the task.

Returns

  • Task object.

# File lib/projects/api/TasksAPI.rb, line 92
def get(projectId, taskId)
        url = getBaseURL+"projects/"+String(projectId)+"/tasks/"+String(taskId)+"/"
        response = ZohoHTTPClient.get(url, getQueryMap)             
        return $taskParser.getTask(response)
end
getComments(projectId, taskId, queryMap) click to toggle source
  • Get all the task comment.

Parameters

  • projectId
    • ID of the project.

  • taskId
    • ID of the task.

Returns

  • List of Comment object.

# File lib/projects/api/TasksAPI.rb, line 188
def getComments(projectId, taskId, queryMap)

        url = getBaseURL+"projects/"+String(projectId)+"/tasks/"+String(taskId)+"/comments/"
        
        response = ZohoHTTPClient.get(url, getQueryMap(queryMap))
        
        return @taskParser.getComments(response)
        
end
getSubtasks(projectId, taskId, queryMap) click to toggle source
  • Get all the subtasks of the given task.

Parameters

  • projectId
    • ID of the project.

  • taskId
    • ID of the task.

Returns

  • List of Task object.

# File lib/projects/api/TasksAPI.rb, line 166
def getSubtasks(projectId, taskId, queryMap)

        url = getBaseURL+"projects/"+String(projectId)+"/tasks/"+String(taskId)+"/subtasks/"
        
        response = ZohoHTTPClient.get(url, getQueryMap(queryMap))
        
        return @taskParser.getTasks(response)
end
getTasklistTasks(projectId, tasklistId, queryMap) click to toggle source
  • Get list of tasks for the task list.

Parameters

  • projectId
    • ID of the project.

  • tasklistId
    • ID of the tasklist.

  • queryMap
    • This queryMap contains the filters in the form of key-value pair.

Returns

  • List Task object.

# File lib/projects/api/TasksAPI.rb, line 74
def getTasklistTasks(projectId, tasklistId, queryMap)
        url = getBaseURL+"projects/"+String(projectId)+"/tasklists/"+String(tasklistId)+"/tasks/"
        response = ZohoHTTPClient.get(url, getQueryMap(queryMap))           
        return $taskParser.getTasks(response)
end
getTasks(projectId, queryMap) click to toggle source
  • Get list of tasks for the project.

Parameters

  • projectId
    • ID of the project.

  • queryMap
    • This queryMap contains the filters in the form of key-value pair.

Returns

  • List of Task object.

# File lib/projects/api/TasksAPI.rb, line 54
def getTasks(projectId, queryMap)
        url = getBaseURL+"projects/"+String(projectId)+"/tasks/"
        response = ZohoHTTPClient.get(url, getQueryMap(queryMap))
        return $taskParser.getTasks(response)
end
update(projectId, task) click to toggle source
  • Update the details of a task.

Parameters

  • projectId
    • ID of the project.

  • task
    • Task object.

Returns

  • Task object.

# File lib/projects/api/TasksAPI.rb, line 128
def update(projectId, task)
        url = getBaseURL+"projects/"+String(projectId)+"/tasks/"+String(task.getId())+"/"           
        response = ZohoHTTPClient.post(url, getQueryMap, task.toParamMAP)           
        return $taskParser.getTask(response)
end