2

Rally Webservices API では、ストーリー階層をトラバースする場合、親ストーリーのクエリを実行し、返されたストーリーから Children コレクションを取得し、プロセスが到達するまで各子に対して再帰的にクエリを実行する必要があります。葉ノードの結果。

質問 - Lookback API で単一のクエリを使用して、反復せずにこれを行う便利な方法はありますか?

4

1 に答える 1

2

This is one of the best features of the Lookback API.

Let's say you have this hierarchy:

  • Story 444
    • Story 555
      • Story 666
        • Defect 777 (via the Requirement field)
          • Task 12
        • Task 13
    • Story 888

The document for Task 12 would look like this:

{
  ObjectID: 12,
  _Type: "Task",
  WorkProduct: 777,
  _ItemHierarchy: [444, 555, 666, 777, 12],
  ...
}

So when you submit a query against a field with an array value (like _ItemHierarchy), it will match any member of the array.

To get everything that descend from 444 your find clause would include _ItemHierarchy: 444. See how that matches the _ItemHierarchy value for Task 12?

To get everything that descend from 333 your find clause would include _ItemHierarchy: 333. This also matches on Task 12.

To get just the Stories that descend from 444 (all Stories) your find clause would include:

  _ItemHierarchy: 444,
  _Type: "HierarchicalRequirement"

To get just the leaf Stories just add the clause Children: null.

The _ItemHierarchy also goes all the way up to PortfolioItems.

_ItemHierarchy is indexed so these queries should be very efficient.

于 2012-05-23T23:35:03.057 に答える