Way to get all items (across all boards / workspaces) that have a specific status via API

Hi there,

Just wondering if there is an easy way to return all tasks /items that have a specific priority value (ie ‘blocker’) across all boards and workspaces we have access to via the API.

We have hundreds of boards so looking to avoid querying by individual board.

Thanks

Hello there @B.H and welcome to the community!

I hope you like it here :muscle:

There is no way of doing that. You will have to go through each board.

Let me know if you have any other questions :slightly_smiling_face:

Cheers,
Matias

Thanks, @matias i figured as much.

So moving on from that plan we now need to implement webhooks on each board to listen for “Blocker” status values.

I added an automation as a test on one of the boards so I could see how it specified the webhook params but it seems to focus on color and indexes rather than the specific selected label of “Blocker”

eg

{
        "id": "4688629",
        "event": "change_status_column_value",
        "board_id": "1851931940",
        "config": "{\"columnId\"=>{\"boardId\"=>1851931940, \"columnId\"=>\"priority\", \"columnType\"=>\"color\"}, \"columnValue\"=>{\"index\"=>3}}"
},

Is there a way to define the webhook based on the label rather than the color index - im concerned this may not be the same for all boards.

So basically when priority is set to ‘Blocker’ trigger webhook.

I am looking to create these for each board using the API so if you could assist with the appropriate settings for the config values for a create webhook mutation based on the label having a value of blocker that would be appreciated.

Hello again,

In this case, you will have to check for the index in which “Blocker” is set in each board with a query like this one:

{
  boards(ids: 1234567890) {
    columns(ids: "status") {
      settings_str
    }
  }
}

And then use that index to create the webhook in that board for that index:

Cheers,
Matias

mutation {
  create_webhook(
    board_id: 1234567890
    event: change_status_column_value
    config: "{\"columnId\":\"status\", \"columnValue\":{\"index\" : \"1\"}}"
    url: "https://abcd-11-111-11-111.ngrok-free.app/webhook"
  ) {
    id
  }
}

Nice one, thanks @Matias.Monday that did the trick

I am glad I could help @B.H :grin: