2

How do I get the order of items in a board view column from the API? I found the sortBy object in the ProjectV2 views, but I'm struggling querying the items ordered by fieldValue (position?).

Would you mind helping me construct a query for the JSON equivalent of the data in the picture, please?

image

4
  • I also asked the same question in the Github Community, just in case Commented Sep 8, 2022 at 15:41
  • Did you work this out Adam? Commented Sep 21, 2022 at 10:17
  • Hey, Ben, I did not. But I suspect there might not be such a thing as Order in Column in Github Projects V2 data design at all. I think there's only an Order of Items in the entire Project and the column is "view" in the scope of the Field Value. Commented Sep 22, 2022 at 9:35
  • 1
    What I did: - created custom select field A with options A1, A2, A3 - created custom select field B with options B1, B2, B3 - created two different boards, columns by A and B options - created three Items (cards) "One", "Two", "Three", all with custom Field A value A1, custom Field B value B1 - reordered the items in the board A - the order is the Items node order in the GrapQL API - BUT the order propagated to the board B - when I reorder the items in the board B - the order propagates to the board A and again to the Items order in the API Commented Sep 22, 2022 at 9:42

1 Answer 1

0

I find a example, it may helps.

You can use orderBy: {field: CREATED_AT, direction: ASC} as below shows.

query MyQuery {
  repository(name: "dbeaver", owner: "dbeaver") {
    issues(first: 100, filterBy: {labels: "bug", createdBy: "2022-01-01..*"}, orderBy: {field: CREATED_AT, direction: ASC}) {
      edges {
        node {
          createdAt
          labels(first: 100) {
            edges {
              node {
                name
              }
            }
          }
        }
      }
      totalCount
    }
  }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.