有没有办法使用pyral Python库为已关闭的项目获取Rally Stories?
在关闭的项目中使用rally.get(...)
故事时,不会返回。这是使用的代码:
from pyral import Rally
rally = Rally(...)
rally_id = 'S123456'
response = rally.get('UserStory',
query='FormattedID = %s AND Project.State = "Closed"' % rally_id,
fetch=True, instance=True)
响应中没有结果。但是,上面的示例ID S123456
是一个有效的Rally Story ID。它只是一个封闭项目的一部分。
此外,添加我认为查询param语法来查找此故事仍然没有用,也没有引发任何Python错误。
正在使用的代码版本:
以下是调用上述代码时出现的错误。该错误基本上意味着Rally.get(...)
请求无法找到实例。
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/Users/alelevier/Documents/rally_jira_sync/venv/lib/python2.7/site-packages/IPython/core/formatters.pyc in __call__(self, obj)
697 type_pprinters=self.type_printers,
698 deferred_pprinters=self.deferred_printers)
--> 699 printer.pretty(obj)
700 printer.flush()
701 return stream.getvalue()
/Users/alelevier/Documents/rally_jira_sync/venv/lib/python2.7/site-packages/IPython/lib/pretty.pyc in pretty(self, obj)
401 if cls is not object \
402 and callable(cls.__dict__.get('__repr__')):
--> 403 return _repr_pprint(obj, self, cycle)
404
405 return _default_pprint(obj, self, cycle)
/Users/alelevier/Documents/rally_jira_sync/venv/lib/python2.7/site-packages/IPython/lib/pretty.pyc in _repr_pprint(obj, p, cycle)
701 """A pprint that just redirects to the normal repr function."""
702 # Find newlines and replace them with p.break_()
--> 703 output = repr(obj)
704 for idx,output_line in enumerate(output.splitlines()):
705 if idx:
/Users/alelevier/Documents/rally_jira_sync/venv/lib/python2.7/site-packages/pyral/rallyresp.pyc in __repr__(self)
408 else:
409 blurb = "%sResult TotalResultCount: %d Results: %s" % \
--> 410 (self.request_type, self.resultCount, self.content['Results'])
411 return "%s %s" % (self.status_code, blurb)
412
KeyError: 'Results'