class TrackerApi::Resources::Project
Public Instance Methods
Provides a list of all the activity performed on a project.
@param [Hash] params @return [Array]
# File lib/tracker_api/resources/project.rb, line 159 def activity(params={}) Endpoints::Activity.new(client).get_project(id, params) end
Add a new membership for the project.
@param [Hash] params attributes to add a member; must have at least email or user_id @return [ProjectMembership] member that was added to project
# File lib/tracker_api/resources/project.rb, line 199 def add_membership(params) Endpoints::Memberships.new(client).add(id, params) end
Create a new webhook for the project.
@param [Hash] params attributes to add a webhook; must have webhook_url, webhook_version @return [Webhook] webhook that was added to project
# File lib/tracker_api/resources/project.rb, line 215 def add_webhook(params) Endpoints::Webhook.new(client).create(id, params) end
Create a new epic in the project.
@param [Hash] params attributes to create the epic with @return [epic] newly created Epic
# File lib/tracker_api/resources/project.rb, line 191 def create_epic(params) Endpoints::Epic.new(client).create(id, params) end
Create a new story in the project.
@param [Hash] params attributes to create the story with @return [Story] newly created Story
# File lib/tracker_api/resources/project.rb, line 175 def create_story(params) Endpoints::Story.new(client).create(id, params) end
Delete webhook from the project.
@return true of false depends on result of delition
# File lib/tracker_api/resources/project.rb, line 222 def delete_webhook(webhook_id) Endpoints::Webhook.new(client).delete_from_project(id, webhook_id) end
Find a epic by id for the project.
@param [Fixnum] epic_id id of epic to get @return [Epic] epic with given id
# File lib/tracker_api/resources/project.rb, line 183 def epic(epic_id, params={}) Endpoints::Epic.new(client).get(id, epic_id, params) end
Provides a list of all the epics in the project.
@param [Hash] params @return [Array] epics associated with this project
# File lib/tracker_api/resources/project.rb, line 69 def epics(params={}) if @epics && @epics.present? @epics else @epics = Endpoints::Epics.new(client).get(id, params) end end
Provides a list of all the iterations in the project.
@param [Hash] params @option params [String] :scope Restricts the state of iterations to return.
If not specified, it defaults to all iterations including done. Valid enumeration values: done, current, backlog, current_backlog.
@option params [Integer] :number The iteration to retrieve, starting at 1 @option params [Integer] :offset The offset of first iteration to return, relative to the
set of iterations specified by 'scope', with zero being the first iteration in the scope.
@option params [Integer] :limit The number of iterations to return relative to the offset. @return [Array] iterations associated with this project
# File lib/tracker_api/resources/project.rb, line 100 def iterations(params={}) if params.include?(:number) number = params[:number].to_i raise ArgumentError, ':number must be > 0' unless number > 0 params = params.merge(auto_paginate: false, limit: 1) params.delete(:number) offset = number - 1 params[:offset] = offset if offset > 0 end Endpoints::Iterations.new(client).get(id, params) end
@return [Integer] comma separated list of label_ids
# File lib/tracker_api/resources/project.rb, line 49 def label_ids @label_ids ||= labels.collect(&:id).join(',') end
@return [String] comma separated list of labels
# File lib/tracker_api/resources/project.rb, line 44 def label_list @label_list ||= labels.collect(&:name).join(',') end
Provides a list of all the labels on the project.
@param [Hash] params @return [Array] labels of this project
# File lib/tracker_api/resources/project.rb, line 57 def labels(params = {}) if @labels && @labels.present? @labels else @labels = Endpoints::Labels.new(client).get(id, params) end end
Provides a list of all the memberships in the project.
@param [Hash] params @return [Array] memberships of this project
# File lib/tracker_api/resources/project.rb, line 151 def memberships(params={}) Endpoints::Memberships.new(client).get(id, params) end
Provides a list of all the releases in the project.
@param [Hash] params @option params [String] :with_state A release's current_state which all returned releases must match.
Valid enumeration values: accepted, delivered, finished, started, rejected, unstarted, unscheduled
@option params [Integer] :offset With the first release in your priority list as 0,
the index of the first release you want returned.
@option params [Integer] :limit The number of releases you want returned. @return [Array] releases associated with this project
# File lib/tracker_api/resources/project.rb, line 143 def releases(params={}) Endpoints::Releases.new(client).get(id, params) end
Search for a term in the given project. This can be an arbitrary term or a specific search query. See www.pivotaltracker.com/help/articles/advanced_search/
@param [String] query A versatile search query @param [Hash] params @return [SearchResultsContainer] An object composed of Epic(s) [EpicsSearchResult] and Story(s) [StoriesSearchResults]
# File lib/tracker_api/resources/project.rb, line 232 def search(query, params={}) Endpoints::Search.new(client).get(id, query, params) end
Provides a list of all the stories in the project.
@param [Hash] params @option params [String] :with_label A label name which all returned stories must match. @option params [String] :with_state A story's current_state which all returned stories must match.
Valid enumeration values: accepted, delivered, finished, started, rejected, unstarted, unscheduled
@option params [String] :filter This parameter supplies a search string;
only stories that match the search criteria are returned. Cannot be used together with any other parameters except limit and offset. ex) state:started requester:OWK label:"jedi stuff" keyword
@option params [Integer] :offset With the first story in your priority list as 0,
the index of the first story you want returned.
@option params [Integer] :limit The number of stories you want returned. @return [Array] stories associated with this project
# File lib/tracker_api/resources/project.rb, line 130 def stories(params={}) Endpoints::Stories.new(client).get(id, params) end
Find a story by id for the project.
@param [Fixnum] story_id id of story to get @return [Story] story with given id
# File lib/tracker_api/resources/project.rb, line 167 def story(story_id, params={}) Endpoints::Story.new(client).get(id, story_id, params) end
Find a webhook for the project.
@param [Fixnum] webhook_id id of webhook to get @return [Webhook] webhook with given id
# File lib/tracker_api/resources/project.rb, line 207 def webhook(webhook_id, params={}) Endpoints::Webhook.new(client).get(id, webhook_id, params) end
Provides a list of all the webhooks in the project.
@param [Hash] params @return [Array] epics associated with this project
# File lib/tracker_api/resources/project.rb, line 81 def webhooks(params={}) if @webhooks && @webhooks.present? @webhooks else @webhooks = Endpoints::Webhooks.new(client).get(id, params) end end