Add epic_id param to issue update graphQL mutation
What does this MR do?
EE::Issues::UpdateService
and EE::Issues::CreateService
Changes in We already handle epic
and epic_id
param in the service. We, however, handle each of them differently which does not seem right. When we use epic_id
we simply assign an epic to an issue. There is, however, more to it. 2 main things are creating notes and moving the issue to the top in the epic structure. All these things are handled by EpicIssues::CreateService
which was always called when epic
param is used but not for epic_id
.
Additionally, when epic
param is set to nil
the link between epic and issue is destroyed.
This MR basically changes handling epic_id
param and handles it similarly as epic
. So an issue is assigned to an epic, moved to the to and notes are created. If epic_id = nil
the association is removed. It also uses same methods for create and update
Graphql update issue mutation
The mutation actually already accepts epic_id
param without actual execution changes (with limits described above) so here we only add documentation and proper specs.
Examples
Assigning an epic
mutation {
updateIssue(input: {projectPath: "flightjs/flight", iid: "592", epicId: 56}) {
issue {
id
epic {
id
title
}
}
errors
}
}
Unassigning from an epic
mutation {
updateIssue(input: {projectPath: "flightjs/flight", iid: "592", epicId: null}) {
issue {
id
epic {
id
title
}
}
errors
}
}
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines - [-] Merge request performance guidelines
-
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Issue #230440 (closed)