1

I have a basic dropdown that contains all the tags defined for a project and two extra fields "All" and "None". The dropdown is used to filter stories on a cardboard. I have managed to make it work for individual tags and the "All" field (to show all user stories) but am having difficulties filtering the cardboard by user stories that do not have tags associated with them.

My cardboard config looks similar to this:

var cardboardConfig = {
    types: ['HierarchicalRequirement'],
    attribute: "ScheduleState",
    sortAscending: true,
    order: "Rank",
    fetch: "Name,FormattedID,Owner,ObjectID,Tags,Discussion",    
};

For the cardboardConfig.query, I have some logic to generate the query that eventually looks similar to this:

'Tags contains "/tag/12345"'

I know Tags is an array containing Tag objects and I've written a test that showed that stories that don't have tags associated with them have an empty Tags array, so I tried the following to query for stories without tags but all didn't return any results:

'Tags = null'
'Tags = []'
'Tags contains null'
'Tags contains ""'

On the net and stackoverflow, there are answers saying that Rally doesn't support not contains so I couldn't do the reciprocate of filtering the cardboard by all stories that have tags as well.

4

3 回答 3

1

好消息!到今天为止,这在 WSAPI v2.0 中得到了支持!

?query=(Tags.ObjectID = null)

在 SDK 中,它看起来像这样:

storeConfig: {
    filters: [
        {
            property: 'Tags.ObjectID',
            value: null
        }
    ]
}

同样, (Tags.ObjectID != null) 应该返回至少有一个标签的故事。

于 2014-02-19T02:27:36.997 回答
0

您的应用使用的是哪个版本的 SDK?无论如何,我相信您需要在 storeConfig 中指定“filters”配置选项,如下所示:

var cardboardConfig = {
    types: ['HierarchicalRequirement'],
    attribute: "ScheduleState",
    sortAscending: true,
    order: "Rank",
    fetch: "Name,FormattedID,Owner,ObjectID,Tags,Discussion",
    query: '(Tags = null)'
};
于 2012-09-11T17:05:50.607 回答
0

不幸的是,您是正确的——Rally 的 WSAPI 不支持集合的 is-empty(或 !is-empty)运算符。

我鼓励你在这里投票:
https ://ideas.rallydev.com/ideas/D2055

于 2012-09-11T17:58:09.170 回答