0

I am using the BB API and in particular the issues division. At the moment i am using the following to get all issue then looping through to get what i require but i noticed that we can add a filter option to get just the required issues back.

  $issue->all(account, repo);

But looking into the api code noticed the $options param. But i cannot find any doc or details on how to supply the $options values. I have tried the following

  $issue->all(account, repo, array('filter'=>array('status','new));

But this does not play ball.

So how can i use this third param $options so that i can use the filter setting?

for reference i am using gentlero/bitbucket-api for the php backend and this is where the all function is

Simon Davies
  • 3,668
  • 9
  • 41
  • 69

2 Answers2

0

looking closer and with more paitence i used the following and it seemded to work:

  $issue->all(account, repo,array('status' => 'resolved'));
Simon Davies
  • 3,668
  • 9
  • 41
  • 69
  • At first I wrote that library for some internal use and when I saw that no other PHP library existed for Bitbucket, I decided to open source it. I admit that has a poor documentation, but you can find a few "raw" usage example inside "[example](https://bitbucket.org/gentlero/bitbucket-api/src/415e5453835b8522b9f751089cf2f035e6b553a1/example?at=master)" directory from the repository. If you encounter any problems with this library or if you have suggestions, you can open an issue on Bitbucket. I hope the library will help you. – Alexandru Guzinschi Oct 30 '13 at 19:05
0

The initial query request can be filtered if you append the following to the request

?q=state="new" or ?q=state="resolved"


Examples:

Resolved issues:

https://api.bitbucket.org/2.0/repositories/craigiswayne/pipelines-playground/issues?q=state=%22resolved%22

New issues:

https://api.bitbucket.org/2.0/repositories/craigiswayne/pipelines-playground/issues?q=state=%22new%22


Documentation Reference:

https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering#supp-endpoints

Craig Wayne
  • 4,499
  • 4
  • 35
  • 50