Skip to content

Add API endpoint for epic boards lists

Eugenia Grieff requested to merge 385904-rest-api-get-epic-board-lists into master

Related to #385904 (closed)

What does this MR do and why?

Adds the following endpoints to retrieve epic board lists for a given group:

GET /groups/:id/epic_boards/:board_id/lists
GET /groups/:id/epic_boards/:board_id/lists/:list_id

Only lists of type label are returned (to match issue boards endpoint) and they contain the following fields:

id -> Integer
label -> Entities::LabelBasic
position -> Integer
list_type -> String
collapsed -> boolean

How to set up and validate locally

  1. Create a private group with multiple labels and epics
  2. Visit the group's epic boards in http://gdk.test:3000/groups/{GROUP_ID}/-/epic_boards and create more boards with lists
  3. Test the following endpoints with a guest and a non-member:
export GUEST_PAT=<guest user api token>
export NON_MEMBER_PAT=<non-member api token>

# Fetch multiple epic board lists

curl --header "PRIVATE-TOKEN: NON_MEMBER_PAT" "http://gdk.test:3000/api/v4/groups/{GROUP_ID}/epic_boards/{BOARD_ID}/lists"
# returns {"message":"404 Group Not Found"}

curl --header "PRIVATE-TOKEN: GUEST_PAT" "http://gdk.test:3000/api/v4/groups/{GROUP_ID}/epic_boards/{BOARD_ID}/lists"
# returns the correct response containing all epic board lists for the group

curl --header "PRIVATE-TOKEN: GUEST_PAT" "http://gdk.test:3000/api/v4/groups/{GROUP_ID}/epic_boards/{BOARD_ID}/lists?page=1&per_page=1"
# returns the correct paginated response

curl --header "PRIVATE-TOKEN: GUEST_PAT" "http://gdk.test:3000/api/v4/groups/{GROUP_PATH}/epic_boards/{BOARD_ID}/lists"
# returns the correct response containing all epic board lists when using the group path

# Fetch a single epic board list by its ID

curl --header "PRIVATE-TOKEN: GUEST_PAT" "http://gdk.test:3000/api/v4/groups/{GROUP_ID}/epic_boards/{BOARD_ID}/lists/{LIST_ID}"
# returns the correct response containing the single epic board list

curl --header "PRIVATE-TOKEN: NON_MEMBER_PAT" "http://gdk.test:3000/api/v4/groups/{GROUP_ID}/epic_boards/{BOARD_ID}/lists/{LIST_ID}"
# returns {"message":"404 Group Not Found"}
Example response for epic board lists
[
  {
    "id": 18,
    "label": {
      "id": 118,
      "name": "green",
      "description": "",
      "description_html": "",
      "text_color": "#FFFFFF",
      "color": "#00b140"
    },
    "position": 0,
    "list_type": "label",
    "collapsed": false
  },
  {
    "id": 17,
    "label": {
      "id": 119,
      "name": "pink",
      "description": "",
      "description_html": "",
      "text_color": "#FFFFFF",
      "color": "#c21e56"
    },
    "position": 1,
    "list_type": "label",
    "collapsed": false
  }
]

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 Eugenia Grieff

Merge request reports