Projects API: no way to create or update a view sorted by Created, Updated or Closed #214482
Unanswered
codeforester
asked this question in
Projects and Issues
Replies: 1 comment
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
Projects
Body
I manage GitHub Project views from code: each view's columns, grouping and sort are written down in a spec and applied through the API. One common setting can't be applied through any API, and REST view creation behaves in a few ways the docs don't mention. I tested on 2026-12-01 against an organization-owned Project, using REST with
X-GitHub-Api-Version: 2026-03-10and GraphQL.1. No API can sort a view by Created, Updated or Closed
A status board sorted by Closed, newest first, can only be set up in the UI.
REST has only create endpoints for views:
POST /orgs/{org}/projectsV2/{project_number}/viewsand the user-owned equivalent. When creating a view,sort_byrejects the built-in fields whose GraphQLdataTypeisCREATED,UPDATEDorCLOSED:It returns HTTP 400:
{"message": "Field validation errors", "errors": {"unsupported_ids": [CLOSED_ID]}, "status": "400"}The field IDs come from GraphQL
ProjectV2Field.databaseId.GraphQL
createProjectV2ViewandupdateProjectV2Viewcan't set sort or grouping at all. Theirconfigurationinput,ProjectV2ViewConfigurationInput, has onlyvisibleFieldIds.So a tool can't create a view with this sort, and it can't change the sort or grouping of any existing view. For other fields, the only route is to delete the view and create it again through REST. That changes the view's URL and breaks every link to it.
2. REST view create: three behaviors the docs don't mention
Each of these has a workaround, but I had to find them by trial and error.
Created, Updated and Closed are also rejected in
visible_fields, with the same error:returns
{"message": "Field validation errors", "errors": {"unsupported_ids": [CREATED_ID, UPDATED_ID]}}The
visible_fieldsorder is ignored.visible_fieldsin that same sorted order, with no error or warning.The fields endpoint leaves these three fields out.
GET /orgs/{org}/projectsV2/{project_number}/fieldsdoesn't list Created, Updated or Closed, so a client that uses only REST can't find their IDs. GraphQL lists them.What works
visible_fields,group_byandsort_by;vertical_group_byon Status for a board;updateProjectV2Viewaccepts Created, Updated and Closed inconfiguration.visibleFieldIds, and keeps the order given.Workaround:
updateProjectV2View.Requests, most valuable first
ProjectV2ViewConfigurationInput, or add a REST endpoint that updates a view. Tools could then fix a view in place and keep its URL.sort_byandvisible_fields.visible_fields, or document that it's ignored.Guidelines
All reactions