kimon
kimon

Reputation: 2505

Querying with SDK2.0: OR filters together

This example in the documentation shows how to query the Rally WS API, using a single item in a filters array:

Ext.create('Rally.data.WsapiDataStore', {
    model: userStoryModel,
    fetch: true,
    filters: [
        {
            property: 'ScheduleState',
            operator: '<',
            value: 'Accepted'
         }
   ],
...

I know if I have a second filter to the filters array, it AND's the two filters together. But how would I OR two filters?

Upvotes: 2

Views: 127

Answers (1)

Kyle Morse
Kyle Morse

Reputation: 8400

You can use Rally.data.QueryFilter's or method to do this:

filters: [
    Ext.create('Rally.data.QueryFilter', {
        property: 'ScheduleState',
        operator: '=',
        value: 'Accepted'
    }).or(Ext.create('Rally.data.QueryFilter', {
        property: 'ScheduleState',
        operator: '=',
        value: 'Defined'
    })
]

Upvotes: 1

Related Questions