Query for List of user stories in rally that are not in the feature's Release - rally

I am trying to add a custom list on my dashboard that shows me a list of all user stories that are not part of the feature release
(Release.Name != Feature.Release.Name) isn't working

WSAPI does not support expressions as the right hand side of a query, so you won't be able to use a custom list to find this data exactly.
But, if you know the name of the release you're looking at you can craft a query like this:
((Release.Name != "My Release") AND (Feature.Release.Name = "My Release"))
That would give you all stories with a different release than their parent feature.

Related

How to get the list of all User stories including child stories using /slm/webservice/v2.0/hierarchicalrequirement API

I am using this rally API to get the list of all the stories:
https://rally-n.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?query=(Project.Name="My_Parent_Project")&order=OrderString
My_Parent_Project actually do not have any user stories, but its children projects (my_child_1 and my_child_2) has user stories.
Is there any specific field, which I can mention to get all the user stories including child projects.
I can see Rally UI has option to get the data from Child project. So I believe there must be an option to get this data using above API. (They use projectScopeUp=false&setScopedDown=true which doesn't seems to be working with
"hierarchicalrequirement" API.
You're really close.
It seems like you've already found the project scoping docs:
https://rally1.rallydev.com/slm/doc/webservice/projectscope.jsp
I think if you just swap your (Project.Name = "My_Parent_Project") query to instead use the project=/project/12345 query string parameter and include projectScopeDown=true you should be all set.

How to Get User Story for a Task Using Visual Studio REST API

I'm trying to use Visual Studio's API to gather information about work items for a Visual Studio Online team into an Excel doc. I can get the work items' information as well as whether each item is a User Story, Task, or Bug by using API calls to extract its json fields. However, I can't figure out how to get the "parent" User Story for a Task or a Bug. E.g. a task will be within a User Story section on my work board, but I don't see any field that corresponds to that story within the work item's possible json keys.
The keys I can see for a work item are these:
['System.AuthorizedDate',
'System.WorkItemType',
'System.Title',
'System.IterationLevel1',
'System.IterationLevel2',
'System.History',
'System.AreaId',
'System.NodeName',
'Microsoft.VSTS.Common.ActivatedDate',
'System.IterationId',
'System.IterationPath',
'System.PersonId',
'System.AssignedTo',
'System.AuthorizedAs',
'System.Id',
'System.Reason',
'System.CreatedBy',
'Microsoft.VSTS.Common.StateChangeDate',
'Microsoft.VSTS.Common.Priority',
'System.Watermark',
'Microsoft.VSTS.Common.ActivatedBy',
'System.AreaPath',
'System.State',
'System.ChangedDate',
'System.AreaLevel1',
'System.CreatedDate',
'System.TeamProject',
'System.Rev',
'System.ChangedBy',
'System.RevisedDate']
None of their values corresponds to anything that matches a User Story's text or provides a url to a User Story's json.
Does anyone know how to get parent (User Story) of a task or a bug using API calls?
Add "expand=all" or "expand=relations" in your request url will show the linked work items and "System.LinkTypes.Hierarchy-Reverse" type point to the Parent work item.
Example:
https://xxxxx.visualstudio.com/defaultcollection/_apis/wit/workitems?ids=47&$expand=relations&api-version=1.0

How do I programmatically create a new TFS Task?

I'm looking to create a Visual Basic Windows Form Application which has similar input fields to the new task creation page on the browser version of TFS. the idea is to automate some of the form filling saving up on time (is, calculating time estimates based on dates taking into account work hours and weekends, automatically filling out fields)
When i search Google however i keep getting results like customizing TFS or how to make a new task using the interface, however what i am looking for is what classes i'm supposed to use to create a new task and then to save it or search current existing tasks.
So How do I programmatically create a new TFS Task if it's possible? (it should be, Visual Basic and TFS are both Microsoft)
There is an example on MSDN. See this page: "Create a Work Item By Using the Client Object Model for Team Foundation".
The core of the example is:
// Create the work item.
WorkItem userStory = new WorkItem(workItemType)
{
// The title is generally the only required field that doesn’t have a default value.
// You must set it, or you can’t save the work item. If you’re working with another
// type of work item, there may be other fields that you’ll have to set.
Title = "Recently ordered menu",
Description = "As a return customer, I want to see items that I've recently ordered."
};
// Save the new user story.
userStory.Save();

Get users of project

How do I get users (not team members) of a given project using Ruby Rally Toolkit? I am trying to run a query to change the roles of all the users in a given project to "Editor", for that I need to get the list of all users of a project.
Unfortunately there's no easy way to get the list of all Users with ProjectPermissions in a Project. This endpoint:
https://rally1.rallydev.com/slm/webservice/v2.0/Project/12345678910/Editors
Will obtain a list of all Editors in a Project. However that doesn't help very much if you want to promote any Viewers in a Project to Editors - and there's no such collection as:
https://rally1.rallydev.com/slm/webservice/v2.0/Project/12345678910/Viewers
or
https://rally1.rallydev.com/slm/webservice/v2.0/Project/12345678910/Users
Although it would makes sense and be kind of nice if there were.
Unfortunately your only recourse is to query through all Users and their UserPermissions in your Ruby code, examine their ProjectPermissions, and operate on anyone having ProjectPermission.Role = Viewer for the Project of interest. Sorry there's not a better way, at least that I know of.

How can I get a list of items in a Rally instance via the REST API?

I want to get the list of items in the view lookup..but i just cant find what to query for that..i have tries everything but i just dont seem to get how to do it
I have even tried using
https://rally1.rallydev.com/slm/webservice/1.29/subscription.js?fetch=Workspaces,Projects,Name&pretty=true
but that only fetches me the worspace and projects
I am not sure what you mean by view lookup. In any case, it is not possible to query on all work items in a subscription. Here is an example of a query on all defects in a workspace, when Name,FormattedID,State are being fetched:
https://rally1.rallydev.com/slm/webservice/v2.0/defect?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/1111&fetch=Name,FormattedID,State
All queries on work items are workspace scoped. You do not have to provide workspace explicitly as in the example above. If you are currently logged in to Rally in another tab of the same browser the context is already set, and this endpoint will work too:
https://rally1.rallydev.com/slm/webservice/v2.0/defect?&fetch=Name,FormattedID,State
You may want to narrow a scope by using a query parameter, e.g.
https://rally1.rallydev.com/slm/webservice/v2.0/defect?&query=(State = Open)&fetch=Name,FormattedID
Also, v2.0 removed the ability to return child collections in the same response for performance reasons. Now fetching a collection will return an object with the count and the url from which to get the collection data:
https://rally1.rallydev.com/slm/webservice/v2.0/Subscription/7777/Workspaces
where 7777 is OID of the subscription.
If you want to replicate a query in a custom view in Rally UI, open the view to determine the conditions and then build a similar query. Here is an example of a query that imitates a custom view below:
https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?query=((Blocked = true) AND (Owner.UserName = nick01#test.com))