2

I am trying to fetch all the UserStories of a specific Project (say project 'Bolt' in workspace 'ABC').

After the connections are set (using username, password and server) and my workspace is set to a default workspace.

I navigate to a different workspace like below -

rally.setWorkspace('ABC')

rally.setProject('Bolt')

Now to get the UserStories, I write the code as below -

response = rally.get('HierarchicalRequirement', fetch=True)

I see I get a lot more number of UserStories, than we have in that Project.

I try this -

response = rally.get('HierarchicalRequirement', fetch=True, project="Bolt")

Again I see the count is high. Like I have 50 UserStories in Rally for that Project, but here I get 90 UserStories.

Please suggest how can I get the UserStories from a Project.

thank you.

Ejaz
  • 1,504
  • 3
  • 25
  • 51

1 Answers1

2

Please try the following approach:

from pyral import Rally

SERVER = 'SERVER'
USER = 'USER'
PASSWORD = 'PASSWORD'
WORKSPACE = 'WORKSPACE'
PROJECT = 'PROJECT'

if __name__ == '__main__':
    rally = Rally(SERVER, USER, PASSWORD, workspace=WORKSPACE)

    project_req = rally.get('Project', fetch=True, query='Name = "%s"' % (PROJECT))
    project = project_req.next()

    user_stories = rally.get('HierarchicalRequirement', fetch=True, query='Project = %s' % (project.ref))

    for user_story in user_stories:
        #do all required stuff
        pass
user2738882
  • 1,161
  • 1
  • 20
  • 38