brogrammer
brogrammer

Reputation: 11

How to query by Iteration in pyral?

My goal is to pull user stories from previous iterations that have not been Validated. To do this I am using pyral-1.5.2:

user_stories = rally.get('UserStory', project='My Project', fetch=True, query=(('Iteration.OID < "1234"') and ('FlowState.Name != "Validated"')))

The result is a list of user stories that are not in the Validated state, but the iteration condition is completely ignored. I have tried using Iteration.OID, Iteration.Name, and Iteration.StartDate, but none have worked. I have also tried other operators such as "=" and "contains" but did not work. Would like to have a list of user stories in previous iterations (iterations that have already been closed) where the flowstate is not Validated.

How can I query rally by Iteration? And ideally, how can I query only past Iterations?

Upvotes: 0

Views: 193

Answers (1)

brogrammer
brogrammer

Reputation: 11

After some investigation, it seems the quotations were not in the correct position. Very strange that the flowstate filter worked even with the quotations in the wrong spot. This worked:

user_stories = rally.get('UserStory', project='My Project', fetch=True, query='((Iteration.Name < "12345") AND (FlowState.Name != "Validated"))')

Upvotes: 0

Related Questions