timelineItems doesn't work (no results) #57326
Replies: 7 comments 19 replies
-
|
Hey @jesuslinares, thanks so much for reaching out and welcome to the community! I've shared this with our internal teams for feedback and should have feedback for you soon. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
|
I came here because I'm trying to migrate our automation from classic projects to v2 (and it looks like I have 1 month left to do it...) we are using timeline events as well and I'm trying to reverse engineer what Github UI does:
For me it's unfortunate that I can't get all the information via the API for V2 projects, but the classic projects go down in a month... ? |
Beta Was this translation helpful? Give feedback.
-
|
Hey, idk if it cans help we use a polling everyday at midnight to add a label on the concerned Issue. (For example, issue no. 242 was added today to the “Backlog” project. We therefore add a label named “Backlog” and delete it if it is no longer present in the project). It allows us to get our timelines with Unlabeled and Labeled events 👍 |
Beta Was this translation helpful? Give feedback.
-
|
I saw your note about using a daily midnight poll to add/remove labels for tracking when issues enter or leave a project column — that’s a clever way to leverage Labeled/Unlabeled events for timelines 👍 We had a similar need, so I set up periodic polling (shorter intervals) to capture and store actual board status transitions over time. That lets us calculate metrics like Cycle Time and Time in State, which our Scrum Masters use regularly. I wrapped this into a small web app that visualizes issue movements. Overview here: Flow2C.com — or jump straight into the demo: app.flow2c.com. In your workflows, would historical analytics alone be enough, or would near‑real‑time notifications on status changes also be useful? |
Beta Was this translation helpful? Give feedback.
-
|
You'll now see additional events in GraphQL including |
Beta Was this translation helpful? Give feedback.
-
|
This is excellent news! I had Claude run some queries via Summary: GitHub Projects V2 API - What's Available NOW✅ Timeline Events (FULLY WORKING)
✅ Query Filtering (WORKING)Supported query patterns:
Does NOT work (or unknown syntax):
Your Sprint Reporting Possibilities1. Track Mid-Sprint Item Movement# Query all status changes for an issue
issue(number: 38) {
timelineItems(itemTypes: [PROJECT_V2_ITEM_STATUS_CHANGED_EVENT]) {
nodes {
... on ProjectV2ItemStatusChangedEvent {
createdAt
actor { login }
previousStatus
status
wasAutomated
}
}
}
}Result: You can see exactly when someone moved issue #38 from 2. Calculate Time-in-StatusFrom the actual data for issue #34:
3. Filter Project by StatusprojectV2(number: 20) {
currentSprint: items(query: "status:\"Current Sprint\"") {
totalCount # How many items in current sprint
}
done: items(query: "status:Done") {
totalCount # How many completed (27 in your project)
}
}4. Track Who Made ChangesEvery event has
5. Detect Automation vs ManualEvery event has
Practical Example for Your Use CaseQuery to build sprint report: {
organization(login: "software") {
projectV2(number: 20) {
# Get all items that were in current sprint
items(first: 100, query: "status:\"Current Sprint\",Done") {
nodes {
content {
... on Issue {
number
title
# Get the complete timeline
timelineItems(first: 100, itemTypes: [
ADDED_TO_PROJECT_V2_EVENT,
PROJECT_V2_ITEM_STATUS_CHANGED_EVENT
]) {
nodes {
... on AddedToProjectV2Event {
createdAt
wasAutomated
}
... on ProjectV2ItemStatusChangedEvent {
createdAt
actor { login }
previousStatus
status
wasAutomated
}
}
}
}
}
}
}
}
}
}This would give you:
Thanks for getting this in the API! Going to make Sprint Reporting much easier for my team. 🙂 |
Beta Was this translation helpful? Give feedback.
-
|
It looks like it's just for THE It would be great to query when an issue is moved into/out of a Sprint. I think right now we have to poll or use a webhook for that. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Body
I am encountering some issues when trying to retrieve the event history of the issues added to projects (v2). Example:
Specifically, I am using the timelineItems objects, but it seems that only "labeled" events are being displayed. I have already enabled the project-event-details-preview as mentioned in the documentation (https://docs.github.com/en/graphql/overview/schema-previews#project-event-details-preview). Also, I checked that I have enough permissions.
However, I am unable to access the desired event history. Could you please assist me in understanding how to retrieve the complete event history for the issues in question?
This is the query:
Thank you for your attention to this matter.
Beta Was this translation helpful? Give feedback.
All reactions