Module: Teamlab::ProjectsTasks

Included in:
Project
Defined in:
lib/teamlab/modules/projects/projects_tasks.rb

Overview

Module for projects tasks methods

Instance Method Summary collapse

Instance Method Details



50
51
52
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 50

def add_link(parent_task_id, dependence_task_id, link_type)
  @request.post(['task', parent_task_id.to_s, 'link'], dependenceTaskId: dependence_task_id, linkType: link_type)
end

#add_task(project_id, title, options = {}) ⇒ Object



54
55
56
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 54

def add_task(project_id, title, options = {})
  @request.post([project_id.to_s, 'task'], { title: title }.merge(options))
end

#add_task_from_discussion(project_id, message_id) ⇒ Object



58
59
60
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 58

def add_task_from_discussion(project_id, message_id)
  @request.post([project_id.to_s, 'task', message_id.to_s])
end

#check_subscription_to_task_action(task_id) ⇒ Object



34
35
36
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 34

def check_subscription_to_task_action(task_id)
  @request.get(['task', task_id.to_s, 'subscribe'])
end

#create_subtask(task_id, responsible_id, title) ⇒ Object



46
47
48
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 46

def create_subtask(task_id, responsible_id, title)
  @request.post(['task', task_id.to_s], responsible: responsible_id, title: title)
end

#delete_subtask(task_id, subtask_id) ⇒ Object



86
87
88
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 86

def delete_subtask(task_id, subtask_id)
  @request.delete(['task', task_id.to_s, subtask_id.to_s])
end

#delete_task(id) ⇒ Object



90
91
92
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 90

def delete_task(id)
  @request.delete(['task', id.to_s])
end

#get_all_tasks(project_id) ⇒ Object



30
31
32
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 30

def get_all_tasks(project_id)
  @request.get([project_id.to_s, 'task'])
end

#get_my_tasksObject



6
7
8
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 6

def get_my_tasks
  @request.get(%w[task @self])
end

#get_my_tasks_by_status(status) ⇒ Object



22
23
24
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 22

def get_my_tasks_by_status(status)
  @request.get(['task', '@self', status.to_s])
end

#get_my_tasks_with_status(project_id, status) ⇒ Object



42
43
44
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 42

def get_my_tasks_with_status(project_id, status)
  @request.get([project_id.to_s, 'task', '@self', status.to_s])
end

#get_task(id) ⇒ Object



14
15
16
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 14

def get_task(id)
  @request.get(['task', id.to_s])
end

#get_task_by_filter(options = {}) ⇒ Object



10
11
12
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 10

def get_task_by_filter(options = {})
  @request.get(%w[task filter], options)
end

#get_tasks(project_id) ⇒ Object



18
19
20
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 18

def get_tasks(project_id)
  @request.get([project_id.to_s, 'task'])
end

#get_tasks_with_status(project_id, status) ⇒ Object



38
39
40
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 38

def get_tasks_with_status(project_id, status)
  @request.get([project_id.to_s, 'task', status.to_s])
end

#notify_task_responsible(task_id) ⇒ Object



26
27
28
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 26

def notify_task_responsible(task_id)
  @request.get(['task', task_id.to_s, 'notify'])
end

#subscribe_to_task_action(task_id) ⇒ Object



74
75
76
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 74

def subscribe_to_task_action(task_id)
  @request.put(['task', task_id.to_s, 'subscribe'])
end

#update_project_task(task_id, title, options = {}) ⇒ Object



66
67
68
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 66

def update_project_task(task_id, title, options = {})
  @request.put(['task', task_id.to_s], { title: title.to_s }.merge(options))
end

#update_subtask(task_id, subtask_id, responsible_id, title) ⇒ Object



78
79
80
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 78

def update_subtask(task_id, subtask_id, responsible_id, title)
  @request.put(['task', task_id.to_s, subtask_id.to_s], responsible: responsible_id, title: title)
end

#update_subtask_status(task_id, subtask_id, status) ⇒ Object



82
83
84
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 82

def update_subtask_status(task_id, subtask_id, status)
  @request.put(['task', task_id.to_s, subtask_id.to_s, 'status'], status: status)
end

#update_task_milestone(task_id, milestone_id) ⇒ Object



70
71
72
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 70

def update_task_milestone(task_id, milestone_id)
  @request.put(['task', task_id.to_s, 'milestone'], milestoneId: milestone_id)
end

#update_task_status(task_id, status) ⇒ Object



62
63
64
# File 'lib/teamlab/modules/projects/projects_tasks.rb', line 62

def update_task_status(task_id, status)
  @request.put(['task', task_id.to_s, 'status'], status: status)
end