Skip to content

Commit

Permalink
Add pull_requests attribute to Story
Browse files Browse the repository at this point in the history
In order to get it populated, `fields: 'pull_requests'` is required when
calling the method that retrieves the story(ies) - otherwise it's nil
  • Loading branch information
gobetti committed Nov 19, 2020
1 parent 2c656e6 commit 54ae048
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/tracker_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ module Shared
autoload :PrimaryResource, 'tracker_api/resources/primary_resource'
autoload :Project, 'tracker_api/resources/project'
autoload :ProjectMembership, 'tracker_api/resources/project_membership'
autoload :PullRequest, 'tracker_api/resources/pull_request'
autoload :Workspace, 'tracker_api/resources/workspace'
autoload :SearchResultContainer, 'tracker_api/resources/search_result_container'
autoload :StoriesSearchResult, 'tracker_api/resources/stories_search_result'
Expand Down
22 changes: 22 additions & 0 deletions lib/tracker_api/resources/pull_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module TrackerApi
module Resources
class PullRequest
include Shared::Base

attribute :client

attribute :id, Integer
attribute :story_id, Integer
attribute :epic_id, Integer
attribute :owner, String
attribute :repo, String
attribute :number, Integer
attribute :host_url, String
attribute :original_url, String
attribute :status, String
attribute :created_at, DateTime
attribute :updated_at, DateTime
attribute :kind, String
end
end
end
1 change: 1 addition & 0 deletions lib/tracker_api/resources/story.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Story
attribute :owners, [Person]
attribute :planned_iteration_number, Integer
attribute :project_id, Integer
attribute :pull_requests, [PullRequest]
attribute :requested_by, Person
attribute :requested_by_id, Integer
attribute :reviews, [Review]
Expand Down

0 comments on commit 54ae048

Please sign in to comment.