Class: BugherdClient::Resources::Task
- Defined in:
- lib/bugherd_client/resources/task.rb
Constant Summary collapse
- PRIORITIES =
['not set', 'critical', 'important', 'normal','minor']
- STATUSES =
['backlog','todo','doing','done','closed']
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#all(project_id, filter_attributes = {}) ⇒ Object
Get a full list of tasks for a project, including archived tasks.
-
#create(project_id, attributes = {}) ⇒ Object
Create a new Task attributes: description, priority, status, tag_names(Array), requester_id or requester_email, assigned_to_id or assigned_to_email external_id if status is null the Task is automatically put in the Feedback panel “requester_email” can be any email address while “assigned_to_email” needs to be of a current project member.
-
#find(project_id, task_id) ⇒ Object
List details of a task in a given project, includes all data including comments, attachments, etc.
- #update(project_id, task_id, attributes = {}) ⇒ Object
Methods inherited from Base
#initialize, #parse_response, #send_request
Constructor Details
This class inherits a constructor from BugherdClient::Resources::Base
Instance Method Details
#all(project_id, filter_attributes = {}) ⇒ Object
Get a full list of tasks for a project, including archived tasks. filters: updated_since, created_since, status, priority, tag and external_id
18 19 20 21 22 |
# File 'lib/bugherd_client/resources/task.rb', line 18 def all(project_id, filter_attributes={}) params = filter_attributes.empty? ? {} : { params: filter_attributes } raw_response = get_request("projects/#{project_id}/tasks", params) parse_response(raw_response, :tasks) end |
#create(project_id, attributes = {}) ⇒ Object
Create a new Task attributes:
description, priority, status, tag_names(Array),
requester_id or requester_email,
assigned_to_id or assigned_to_email
external_id
if status is null the Task is automatically put in the Feedback panel “requester_email” can be any email address while “assigned_to_email” needs to be of a current project member. Values for “priority” are not set, critical, important, normal, and minor. Values for “status” are backlog, todo, doing, done, and closed. Omit this field or set as “null” to send tasks to the Feedback panel. External ID is an API-only field. It cannot be set from the BugHerd application, only using the API. An external ID can be used to track originating IDs from other systems in BugHerd bugs.
44 45 46 47 |
# File 'lib/bugherd_client/resources/task.rb', line 44 def create(project_id, attributes={}) raw_response = post_request("projects/#{project_id}/tasks", task: attributes) parse_response(raw_response) end |
#find(project_id, task_id) ⇒ Object
List details of a task in a given project, includes all data including comments, attachments, etc.
27 28 29 30 |
# File 'lib/bugherd_client/resources/task.rb', line 27 def find(project_id, task_id) raw_response = get_request("projects/#{project_id}/tasks/#{task_id}") parse_response(raw_response) end |
#update(project_id, task_id, attributes = {}) ⇒ Object
49 50 51 52 |
# File 'lib/bugherd_client/resources/task.rb', line 49 def update(project_id, task_id, attributes={}) raw_response = put_request("projects/#{project_id}/tasks/#{task_id}", task: attributes) parse_response(raw_response) end |