Is there a way to get Rally Stories for closed Projects using the pyral Python library?
When using rally.get(...)
Stories in closed Projects aren't being returned. Here is the code being used:
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)
The response contains no results. But, the above example ID S123456
is a valid Rally Story ID. It's just part of a closed Project.
Also, adding what I think would be the query param syntax to find this Story still didn't work and didn't raise any Python errors either.
Versions of code being used:
- Python 2.7.15
- Pyral 1.4.1 Also back tested in Pyral 1.2.3 and didn't work.
Here is the error that I get when calling the above code. The error basically means, the Rally.get(...)
request failed to find the instance.
---------------------------------------------------------------------------
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'