module Teambition2::API::TaskGroup
Public Instance Methods
create_task_group(project_id, title, template_id: nil, description: nil)
click to toggle source
# File lib/teambition2/api/task_group.rb, line 8 def create_task_group(project_id, title, template_id: nil, description: nil) post('/api/tasklists', { 'title' => title, '_projectId' => project_id, '_templateId' => template_id }) end
task_group(group_id)
click to toggle source
# File lib/teambition2/api/task_group.rb, line 4 def task_group(group_id) get("/api/tasklists/#{project_id}") end
task_group_search(project_id, name, key: 'title', limit: 1)
click to toggle source
# File lib/teambition2/api/task_group.rb, line 16 def task_group_search(project_id, name, key: 'title', limit: 1) result = get("/api/projects/#{project_id}/tasklists").select { |p| p[key].include?(name) } return nil if result.empty? case limit when 0 result when 1 result[0] else result.size >= limit ? result[0..limit] : result end end