2

如何获取对 Rally 中的故事或缺陷所做的更改列表?

for r in rally.get('User Story', fetch=True, query=""): print r.Changesets

r.Changesets似乎总是一个空集合。

我还尝试了这种rally.get('Revision'...)方法,它似乎给我带来了很多修改,但它们不包含对正在修改的对象(故事/缺陷/...)的任何引用。

也尝试使用,query="ObjectID = %s" % r.FormattedID但这总是什么都不返回。

我还在https://github.com/RallyTools/RallyRestToolkitForPython/issues/29上打开了一个错误,但我不确定这是否会很快引起任何关注。

4

1 回答 1

2

Changeset object, which is a collection of Change objects in WS API is not related to revisions. Those objects are intended for integration with version control systems, e.g. Git, GitHub, Mercurial, Subversion connectors, etc, and have no meaning outside of integration context.

It is possible to traverse from an artifact, e.g. a user story to its revisions using the endpoints below. For example a user story query (FormattedID = US123) :

https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?query=(FormattedID%20%3D%20US123)&fetch=true

will include a reference to RevisionHistory object, redacted for brevity

RevisionHistory: 
{
_ref: "https://rally1.rallydev.com/slm/webservice/v2.0/revisionhistory/19382984273", 
_type: "RevisionHistory"
},

This endpoint:

https://rally1.rallydev.com/slm/webservice/v2.0/revisionhistory/19382984273

returns Revision history object that has a referene to Revisions collection

{
RevisionHistory: 
{
_ref: "https://rally1.rallydev.com/slm/webservice/v2.0/revisionhistory/19382984273", 
_objectVersion: "3",
CreationDate: "2014-05-29T15:23:21.491Z",
ObjectID: 19382984273,
Revisions: 
{
_ref: "https://rally1.rallydev.com/slm/webservice/v2.0/RevisionHistory/19382984273/Revisions", 
_type: "Revision",
Count: 5
}
}
}

Here is an example of Revisions endpoint with narrowed fetch

https://rally1.rallydev.com/slm/webservice/v2.0/RevisionHistory/19382984273/Revisions?fetch=RevisionNumber,User,Description,CreationDate

Generally revision history queries are expensive and we do not recommend using them except in narrow scenarios.

v2.0 removed the ability to return child collections in the same response for performance reasons. Per WS API documentation fetching a collection will return an object with the count and the url from which to get the collection data. To get full objects a separate request is needed.

See this post that mentioned LookbackAPI. LBAPI allows to get historic data. There is no built-in support for LookbackAPI in pyral or any other Rally toolkits except AppSDK2 but LBAPI is language agnostic.

于 2014-06-23T16:39:05.977 回答