Not able to get views in graphql query for board

I am trying to get views names and ids for a board. I am trying this query for the same

{
  boards(ids: [1841601504]) {
    name
    views {
      id
      name
    }
  }
}

In response I am getting this

{
  "data": {
    "boards": [
      {
        "name": "New Board",
        "views": []
      }
    ]
  }
}

How can I get the views info ? I am trying this from API playground for now.

Hi @YashGarg

That seems to be the correct way. You won’t see the main table, but should see all the other views.

Here’s a similar query with some results that I see:

Yes I actually saw your post as well today, and saw that you are getting results but I am not. Don’t know what I am doing wrong. Are you running it from api playground or code ?

Wait, just realized it is only giving table type views. If I had 3 extra views like chart, kanban and table view. It only returns a table view. That’s why I was not getting views earlier, as earlier I only had chart and kanban apart from main table. Now the question is - is there a way to get all the views not just table views ?

OK, I’ve had another look and it seems that the query is fine for non-native (type = FeatureBoardView, app) views, but a bit weird for native views.

  • No results for Kanban, File Gallery or Dashboard
  • A result for a form (type= FormBoardView)

In such a case event this documentation is misleading as it shows one of the return values as a kanban view.

1 Like

For this board:

I’m seeing the following…

Query:

query {
  boards(ids: ["****"]) {
    name
    views {
      id
      name
      type
    }
  }
}

Result:

{
  "data": {
    "boards": [
      {
        "name": "Embedded Board",
        "views": [
          {
            "id": "117212181",
            "name": "Embedded Confluence Page",
            "type": "FeatureBoardView"
          },
          {
            "id": "118973150",
            "name": "Broadcast",
            "type": "SppBoardView"
          },
          {
            "id": "138460232",
            "name": "Form",
            "type": "FormBoardView"
          }
        ]
      }
    ]
  },
  ...
}

So, out of 6 views, only 3 are returned.

1 Like

@Matias.Monday can you please look into this ?

Hello there @YashGarg,

Would you be able to please fill this form so our team can take a look into this? Please add as much detail about your case as possible.

Looking forward to hearing from you via the form!

Cheers,
Matias