irphilli/tracker_api

Stories are not being populated with `fields` information

Closed this issue · 1 comments

Hi there! I'm trying to read some project stories, and also bring the "owned_by" field among others. The API seems to be responding correctly, but the objects are not being populated with that info.

project.stories(filter:filter, fields:':default,name,description,requested_by,owned_by')

This is the result

{
"kind"=>"story",
"id"=>84214708,
"created_at"=>"2014-12-09T15:53:40Z",
"updated_at"=>"2014-12-11T18:06:32Z",
"estimate"=>3,
"story_type"=>"feature",
"name"=>
 "As a user I should be able to re-login easily if my session expired ",
"description"=>
 "Design: xxxxxxx",
"current_state"=>"started",
"requested_by_id"=>1486154,
"project_id"=>1168276,
"url"=>"xxxxxxx",
"requested_by"=>
 {"kind"=>"person",
  "id"=>1486154,
  "name"=>"Emiliano Jankowski",
  "initials"=>"EJ",
  "username"=>"emilianoj"},
"owned_by"=>
 {"kind"=>"person",
  "id"=>1486158,
  "name"=>"Lucas Perez",
  "initials"=>"LP",
  "username"=>"lucasperez"},
"owner_ids"=>[1486158],
"labels"=>
 [{"id"=>9865170,
   "project_id"=>1168276,
   "kind"=>"label",
   "name"=>"portal",
   "created_at"=>"2014-10-30T20:46:16Z",
   "updated_at"=>"2014-10-30T20:46:16Z"}]
}

And the object:

@comment_ids=[],
 @created_at=
  #<DateTime: 2014-12-02T23:24:02+00:00 ((2456994j,84242s,0n),+0s,2299161j)>,
 @current_state="started",
 @deadline=nil,
 @description=nil,
 @estimate=2.0,
 @external_id=nil,
 @follower_ids=[],
 @id=83807052,
 @integration_id=nil,
 @kind="story",
 @label_ids=[],
 @labels=
  [#<TrackerApi::Resources::Label:0x007fdbec528e90
    @created_at=
     #<DateTime: 2014-11-17T21:39:13+00:00 ((2456979j,77953s,0n),+0s,2299161j)>,
    @id=10016792,
    @kind="label",
    @name="staff-portal",
    @project_id=1168276,
    @updated_at=
     #<DateTime: 2014-11-17T21:39:13+00:00 ((2456979j,77953s,0n),+0s,2299161j)>>],
 @name=
  "As a staff user I should be able to see a list of projects for each user",
 @owned_by_id=nil,
 @owners=[],
 @planned_iteration_number=nil,
 @project_id=1168276,
 @requested_by_id=1486154,
 @story_type="feature",
 @task_ids=[],
 @tasks=[],
 @updated_at=

Is it an issue or is there any other way of reading that info?

Thanks!

@mustela The owned_by_id and owned_by are deprecated so I did not include them.

Instead try this.

project.stories(filter:filter, fields:':default,name,description,requested_by,owners')

@see https://www.pivotaltracker.com/help/api/rest/v5#story_resource