Fix related work item links syncing
What does this MR do and why?
Do not call Epics::RelatedEpicLinks::CreateService
when target work items don't have a synced epic. If we call this service with the param target_issuable: []
it raises an error in IssuableLinksCreateService#render_not_found_error?
which rollback the transaction.
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
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
- Create a work item epic and a task
- Visit
127.0.0.1:3000/-/graphql-explorer
and use the following mutation to link the task to the work item epic
mutation {
workItemAddLinkedItems(input: {id: "gid://gitlab/WorkItem/WI_EPIC_ID", workItemsIds: ["gid://gitlab/WorkItem/TASK_ID"]}) {
errors
workItem {
title
widgets {
... on WorkItemWidgetLinkedItems {
type
linkedItems {
edges {
node {
workItem {
title
}
}
}
}
}
}
}
}
}
- Verify that no error is present.
Edited by Eugenia Grieff