17557

Lookback API _ProjectHierarchy not scoping down

Question:

Hi I am fetching the current userstories for a particular iteration using the following code

Ext.define('CustomApp', { extend: 'Rally.app.App', componentCls: 'app', launch:function(){ me = this; combo = window.parent.Ext4.ComponentQuery.query('rallyiterationcombobox')[0]; var iterationObjectID = combo.getRecord().data.ObjectID; var query1= { _ProjectHierarchy: me.getContext().getProject().ObjectID, Iteration : iterationObjectID , _TypeHierarchy:"HierarchicalRequirement"}; var fields = ["ObjectID","FormattedID","Name","Parent","Release","Tags","PlanEstimate","ScheduleState","_ValidFrom","_ValidTo"]; var hydrate = ["Tags","ScheduleState"]; var post = { find :query1, fields : fields, hydrate : hydrate, pagesize : 10000 }; var wsid = this.context.getWorkspace().ObjectID; var url = "https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/"+ wsid +"/artifact/snapshot/query.js"; console.log("snapshot url:",url); Ext.Ajax.request({ method: 'POST', url: url, jsonData : post, success: function(res) { res = JSON.parse(res.responseText); console.log("The final results are",res); }, failure: function(failure) { console.log("snapshot query failed!",failure); } });

The problem is that I could not get the user stories of the child projects when I specify the parent project in the query. For example if I have the hierarchy like this

Project 7890 User Story 55 User Story 56 Project 6543 User Story 57 Project 3456 User Story 777

Ideally If I query _ProjectHierarchy: 7890 I should be getting User Story 55,User Story 56,User Story 57,User Story 777 since the query retrieves the multiple work items of itself and its child projects,but here I am only able to get User Story 55,User Story 66(which are userstories of project 7890) but not User Story 57,User Story 777 since those are the User Stories of the child projects. I want to retrieve all User Stories of selected project and its child projects also(i.e scope down).

Answer1:

Check out the <a href="https://rally1.rallydev.com/analytics/doc" rel="nofollow">LBAPI Docs</a> for some good info on this, particularly the difference between _ProjectHierarchy and _ItemHierarchy/_TypeHierarchy.

In your situation, you should probably be using the _ItemHierarchy/_TypeHierarchy:

<strong>Work item hierarchy</strong>

The work item hierarchy traverses a Parent/Child relationship using the _ItemHierarchy field. So if you have this hierarchy:

Story 333 Story 444 Story 555 Story 666 Defect 777 Task 12 Task 13 Story 888 Story 999

The document for Story 666 would look like this:

{ ObjectID: 666, Parent: 555, _ItemHierarchy: [333, 444, 555, 666], ... }

To retrieve all Stories that descend from Story 333 (includes 333, 444, 555, 666, 888, and 999 but not Defect 777), you would include this clause in your query:

{ _ItemHierarchy: 333, _TypeHierarchy: “HierarchicalRequirement” }

<strong>Project hierarchy</strong>

The Project hierarchy is also represented as an array starting at a root Project for this Workspace. So if work item 777 is at the bottom of this Project hierarchy:

Project 7890 Project 6543 Project 3456 Work item 777

The document for work item 777 would look like this:

{ ObjectID: 777, Project: 3456, _ProjectHierarchy: [7890, 6543, 3456], ... }

To retrieve multiple work items that are in Project 7890 or any of its child projects, you would simply include this clause in your query:

_ProjectHierarchy: 7890

Recommend

  • Deserialize XML to Entity with nested nodes using JMS Serializer
  • NHibernate Session.Query, column list?
  • SqlDataReader.Read() always returning false
  • jqGrid scroll bug with big rows
  • stackexchange redis hashscan return all fields in one time
  • SQL pagination returning total number of records before pagination
  • Using STAT relation in CActiveDataProvider criteria
  • How to add paragraph wise texts separated by vertical line into itextsharp created PDF
  • How to get ID of changed file on Google Drive
  • unescape special characters in ajax response data
  • how to store data in database(sqlite)
  • Quickly or concisely determine the longest string per column in a row-based data collection
  • @Autowired for @ModelAttribute
  • redirect user after update in class based view in django
  • How to get the index of element in the List in c#
  • How do i disable a text box within an iframe
  • Programmatically Update Linked Named Range of excel object in MS Word (2007)
  • How to use the resource module to measure the running time of a function?
  • How can i dump blob fields from mysql tables
  • How to assert that an input element is empty in Ruby on Rails tests
  • Returning the auto incrementing value after an insert using slick
  • Magento get URL before current
  • Why must we declare a variable name when adding a method to a struct in Golang?
  • Inline R code in YAML for rmarkdown doesn't run
  • Django simple Captcha “No module named fields” error
  • Rails Find when some params will be blank
  • How can I send an e-mail from a vbs script
  • Sails.js/waterline: Executing waterline queries in toJSON function of a model?
  • Can Jackson SerializationFeature be overridden per field or class?
  • AngularJs get employee from factory
  • Acquiring multiple attributes from .xml file in c#
  • Free memory of cv::Mat loaded using FileStorage API
  • how does django model after text[] in postgresql [duplicate]
  • Memory offsets in inline assembly
  • Turn off referential integrity in Derby? is it possible?
  • How can I remove ASP.NET Designer.cs files?
  • python draw pie shapes with colour filled
  • Is there any way to bind data to data.frame by some index?
  • How can i traverse a binary tree from right to left in java?
  • jQuery Masonry / Isotope and fluid images: Momentary overlap on window resize