Ensure legacy Epic dates have same values from its related WorkItem
What does this MR do and why?
Roadmap relies on Epic API and we plan to move it to use Work Item API as a part of #478011, but until that the expectation is that there is no significant mismatch of data between both the APIs especially because other attributes of Epics are consistent between old and new experience.
To fix that, we're presenting the Epic dates with the WorkItem logic.
To ensure compatibility, we're also updating the REST API to return the same values as the GraphQL API.
Changelog: fixed
References
Related to: #514066 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
For existing Epics that had different fixed/inherited values between start/due dates, we follow the rules on WorkItems UI/API to decided if the dates are fixed/inherited, example:
| Before | After |
|---|---|
|
Legacy view |
Legacy view (side effect) |
How to set up and validate locally
EE license required.
- Create or use an existing group
- Create Epic
E1with fixed dates: start date 01/01/2025 and due date 31/01/2025 - Create Epic
E2as child ofE1, with fixed dates: start date 10/01/2025 and due date 15/01/2025 - Open Epic
E1and change dates toinherited(you should seeE2dates) - Open rails console and update
E1to have just the due date as fixed:
e1 = Group.find_by(path: <YOUR GROUP>).epics.find_by(title: 'E1')
e1.update(due_date_is_fixed: true)
e1.work_item.dates_source.update(due_date_is_fixed: true)
- After that, you can check on
E1(using?force_legacy_view=trueat the end of the URL) that only due date will be fixed, but start date will be inherited. This is not possible on the (new way) WorkItem. - The roadmap on
E1will show- without the fix: start date 10/01/2025 and due date 31/01/2025
- with the fix: start date 01/01/2025 and due date 31/01/2025
GraphQL query for test
query groupEpics {
group(fullPath: <GROUP PATH>) {
epics(iid: <EPIC IID>) {
nodes {
id
title
startDate
startDateFixed
startDateIsFixed
dueDate
dueDateFixed
dueDateIsFixed
}
}
}
}
REST test (using jq)
curl --silent --location --header 'PRIVATE-TOKEN: <ACCESS TOKEN>' --url http://gdk.test:3000/api/v4/groups/<GROUP PATH>/epics/<EPIC IID> | jq '{id, title, start_date, start_date_fixed, start_date_is_fixed, due_date, due_date_fixed, due_date_is_fixed}'




