问题
I'm creating a report that needs to obtain data from a workspace that has several projects in it. Is there a way to specify to either search a whole workspace or multiple projects when creating the RallyDataSource? Creating a data source per project doesn't sound like the best way of going about it.
回答1:
If your projects have one common parent you can specify the parent project and projectScopeDown true:
var rallyDataSource = new rally.sdk.data.RallyDataSource('/workspace/12345',
'/project/23456', false, true);
Otherwise in your queryConfig you can set the project to null to query the entire workspace:
rallyDataSource.findAll({
key: 'stories',
project: null,
type: 'hierarchicalrequirement',
}, callback, errorCallback);
You could further filter it to specific projects like so:
rallyDataSource.findAll({
key: 'stories',
project: null,
type: 'hierarchicalrequirement',
query: '((Project = /project/23456) OR (Project = /project/34567))'
}, callback, errorCallback);
来源:https://stackoverflow.com/questions/7903864/app-sdk-query-data-over-a-workspace-multiple-projects