Class: Asana::Resources::UserTaskList
- Inherits:
-
UserTaskListsBase
- Object
- Resource
- UserTaskListsBase
- Asana::Resources::UserTaskList
- Defined in:
- lib/asana/resources/user_task_list.rb
Overview
A _user task list_ represents the tasks assigned to a particular user. It provides API access to a user’s “My Tasks” view in Asana.
A user’s “My Tasks” represent all of the tasks assigned to that user. It is visually divided into regions based on the task’s [‘assignee_status`](/developers/api-reference/tasks#field-assignee_status) for Asana users to triage their tasks based on when they can address them. When building an integration it’s worth noting that tasks with due dates will automatically move through ‘assignee_status` states as their due dates approach; read up on [task auto-promotion](/guide/help/fundamentals/my-tasks#gl-auto-promote) for more infomation.
Instance Attribute Summary collapse
- #gid ⇒ Object readonly
- #name ⇒ Object readonly
- #owner ⇒ Object readonly
- #resource_type ⇒ Object readonly
- #workspace ⇒ Object readonly
Class Method Summary collapse
-
.find_by_id(client, id, options: {}) ⇒ Object
Returns the full record for a user task list.
-
.find_by_user(client, user: required("user"), workspace: required("workspace"), options: {}) ⇒ Object
Returns the full record for the user task list for the given user.
-
.plural_name ⇒ Object
Returns the plural name of the resource.
Instance Method Summary collapse
-
#tasks(completed_since: nil, per_page: 20, options: {}) ⇒ Object
Returns the compact list of tasks in a user’s My Tasks list.
Methods inherited from UserTaskListsBase
get_user_task_list, get_user_task_list_for_user, inherited
Methods inherited from Resource
#initialize, #method_missing, #refresh, #respond_to_missing?, #to_h, #to_s
Methods included from ResponseHelper
Constructor Details
This class inherits a constructor from Asana::Resources::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Asana::Resources::Resource
Instance Attribute Details
#gid ⇒ Object (readonly)
19 20 21 |
# File 'lib/asana/resources/user_task_list.rb', line 19 def gid @gid end |
#name ⇒ Object (readonly)
23 24 25 |
# File 'lib/asana/resources/user_task_list.rb', line 23 def name @name end |
#owner ⇒ Object (readonly)
25 26 27 |
# File 'lib/asana/resources/user_task_list.rb', line 25 def owner @owner end |
#resource_type ⇒ Object (readonly)
21 22 23 |
# File 'lib/asana/resources/user_task_list.rb', line 21 def resource_type @resource_type end |
#workspace ⇒ Object (readonly)
27 28 29 |
# File 'lib/asana/resources/user_task_list.rb', line 27 def workspace @workspace end |
Class Method Details
.find_by_id(client, id, options: {}) ⇒ Object
Returns the full record for a user task list.
54 55 56 57 |
# File 'lib/asana/resources/user_task_list.rb', line 54 def find_by_id(client, id, options: {}) self.new(parse(client.get("/user_task_lists/#{id}", options: )).first, client: client) end |
.find_by_user(client, user: required("user"), workspace: required("workspace"), options: {}) ⇒ Object
Returns the full record for the user task list for the given user
44 45 46 47 |
# File 'lib/asana/resources/user_task_list.rb', line 44 def find_by_user(client, user: required("user"), workspace: required("workspace"), options: {}) params = { workspace: workspace }.reject { |_,v| v.nil? || Array(v).empty? } Resource.new(parse(client.get("/users/#{user}/user_task_list", params: params, options: )).first, client: client) end |
.plural_name ⇒ Object
Returns the plural name of the resource.
31 32 33 |
# File 'lib/asana/resources/user_task_list.rb', line 31 def plural_name 'user_task_lists' end |
Instance Method Details
#tasks(completed_since: nil, per_page: 20, options: {}) ⇒ Object
Returns the compact list of tasks in a user’s My Tasks list. The returned tasks will be in order within each assignee status group of ‘Inbox`, `Today`, and `Upcoming`.
Note: tasks in ‘Later` have a different ordering in the Asana web app than the other assignee status groups; this endpoint will still return them in list order in `Later` (differently than they show up in Asana, but the same order as in Asana’s mobile apps).
Note: Access control is enforced for this endpoint as with all Asana API endpoints, meaning a user’s private tasks will be filtered out if the API-authenticated user does not have access to them.
Note: Both complete and incomplete tasks are returned by default unless they are filtered out (for example, setting ‘completed_since=now` will return only incomplete tasks, which is the default view for “My Tasks” in Asana.)
83 84 85 86 |
# File 'lib/asana/resources/user_task_list.rb', line 83 def tasks(completed_since: nil, per_page: 20, options: {}) params = { completed_since: completed_since, limit: per_page }.reject { |_,v| v.nil? || Array(v).empty? } Collection.new(parse(client.get("/user_task_lists/#{gid}/tasks", params: params, options: )), type: Task, client: client) end |