Reputation: 1069
Am trying to access the Rally through Rally API key, and am able to connect to Rally. But when i tried to get the list of User stories under a project, am getting InvalidRallyTypeNameError.
Here is my code to connect to Rally
rally=Rally(server="rally1.rallydev.com", apikey="MyAPIkey", workspace='MyWorkspace',projectc='Helloworld')
to get the list of Stories under a project
response=rally.get("project", fetch=False, limit=10) //here is where am getting the error
Please let me know, where am getting wrong.
Upvotes: 1
Views: 172
Reputation: 5966
To get user stories in a project hit hierarchicalrequirement
endpoint and scope it to the project. Here is a curl example, where zsessionid is set to ApiKey, and 678 is a placeholder for project's ObjectID:
curl --header "zsessionid:_abc123" -H "Content-Type: application/json" https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?project=/project/678
Regardless of the language or Api tookit choice, you have to query on hierarchicalrequirement object. Some toolkits may allow using a 'userstory' or 'story' alias, but in the WS API object model user story is referred to as hierarchicalrequirement. Also, project does not have a user stories collection attribute.
When using python toolkit for rally, pyral it will look like this
response = rally.get('HierarchicalRequirement', query=criterion, fetch=fields, order="FormattedID")
where you can limit the criteria to a project.
Upvotes: 1