Post

1 follower Follow
0
Avatar

getItems filter on several field values

Hi,

I would like to be able to filter the getItems call on more that one field value.

If I look at the tutorial I only find an example with one filter setting, 6058630 => 6374.

But what if I want to have 6058630 => 6374 or 6375. (get all items that belongs to a group of users, not only one user). How do I do that? I tried with 6058630 => array(6374,6375) but that one didn't work for me.

// Get all bugs where the Developer is set to a specific user

// Assuming the field_id of the Developer field is 6058630

// And the user_id to filter on is 6374

$items = $api->item->getItems(31060, array(

6058630 => 6374,

'sort_by' => 'created_on',

));

Louise Mattsson Answered

Please sign in to leave a comment.

4 comments

0
Avatar

Do yourself a big favour and stop using getItems. Use filterItems instead. The syntax is easier and we've deprecated getItems for that reason.

With filterItems you can send the array you have above

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink
0
Avatar

Thanks!

Would be nice with some more coding examples, more stuff in the tutorial. :)

Louise Mattsson 0 votes
Comment actions Permalink
0
Avatar

We are working it, but things take time :(

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink
0
Avatar

I know... but this forum is good to have in the meantime! :)

Louise Mattsson 0 votes
Comment actions Permalink