Fix is_blocked_by for epic links

What does this MR do and why?

We already mentioned in the docs that is_blocked_by is supported for the Epic Link API, but we rejected the type. Now we support the is_blocked_by link type for the Epic links:

Issue: #412835 (closed)

More context: We fixed this already for Issues with !110067 (merged) but not for Epics. We can now re-use the .available_link_types on IssuableLink for the validation.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

  • create two epic in a group (e.g. Epic with iid 1 and iid 2)
  • make the API call:
curl --request POST --header "PRIVATE-TOKEN: <access-token>" \
     --header "Content-Type: application/json" \
     --data '{
        "target_group_id": "2", 
        "target_epic_iid": "2", 
        "link_type": "is_blocked_by"
        }' \
     --url 'http://<instance-url>/api/v4/groups/1/epics/1/related_epics'

Before: Error link_type does not have a valid value

After: Sets the related epics correctly with Epic 1 being blocked by epic 2

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Nicolas Dular

Merge request reports

Loading