API: Creating a new issue link of link_type 'is_blocked_by' returns "404 Not found"

Summary

Using the issue link API documented here to create a new issue link with link_type=is_blocked_by creates the link, but the API call returns {"message":"404 Not found"} as a response

Trying the same api call with link_type equal to relates_to or blocks works, and does not cause this problem.

Steps to reproduce

The problem can be reproduced using the simple curl call described in the documentation:

curl -X POST -H "PRIVATE-TOKEN: XXXX" "https://gitlab.com/api/v4/projects/4/issues/1/links?target_project_id=4&target_issue_iid=2&link_type=is_blocked_by"

The problem also occurs if including arguments as data:

curl -X POST -H "PRIVATE-TOKEN: XXXX" "https://gitlab.com/api/v4/projects/4/issues/1/links" -d "target_project_id=4" -d "target_issue_iid=2" -d "link_type=is_blocked_by"

Error is occurring on a GitLab.com project (silver tier)

What is the current bug behavior?

API call fails with {"message":"404 Not found"}, even though the issue link is actually created.

What is the expected correct behavior?

API calls succeeds, and returns the newly created issue link as the response body.

Relevant logs and/or screenshots

curl -v -X POST -H "PRIVATE-TOKEN: XXXX" "https://gitlab.com/api/v4/projects/21486320/issues/20961/links" -d "target_project_id=21486320" -d "target_issue_iid=21574" -d "link_type=is_blocked_by"
Note: Unnecessary use of -X or --request, POST is already inferred.
* Expire in 0 ms for 6 (transfer 0x55ccf5fdaf50)
* Expire in 1 ms for 1 (transfer 0x55ccf5fdaf50)

... (abbreviated)

* Expire in 50 ms for 1 (transfer 0x55ccf5fdaf50)
* Expire in 50 ms for 1 (transfer 0x55ccf5fdaf50)
* Expire in 50 ms for 1 (transfer 0x55ccf5fdaf50)
*   Trying 172.65.251.78...
* TCP_NODELAY set
* Expire in 149949 ms for 3 (transfer 0x55ccf5fdaf50)
* Expire in 200 ms for 4 (transfer 0x55ccf5fdaf50)
* Connected to gitlab.com (172.65.251.78) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=gitlab.com
*  start date: Mar 13 00:00:00 2020 GMT
*  expire date: May 11 23:59:59 2021 GMT
*  subjectAltName: host "gitlab.com" matched cert's "gitlab.com"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x55ccf5fdaf50)
> POST /api/v4/projects/21486320/issues/20961/links HTTP/2
> Host: gitlab.com
> User-Agent: curl/7.64.0
> Accept: */*
> PRIVATE-TOKEN: XXXXX
> Content-Length: 73
> Content-Type: application/x-www-form-urlencoded
> 
* We are completely uploaded and fine
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
< HTTP/2 404 
< date: Wed, 21 Oct 2020 21:06:08 GMT
< content-type: application/json
< content-length: 27
< set-cookie: __cfduid=dbcc09124ec89bad29cdcd50cdbd8ced71603314367; expires=Fri, 20-Nov-20 21:06:07 GMT; path=/; domain=.gitlab.com; HttpOnly; SameSite=Lax; Secure
< cache-control: no-cache
< vary: Origin
< x-request-id: kkFEfnNqeCa
< x-runtime: 0.368833
< ratelimit-limit: 600
< ratelimit-observed: 1
< ratelimit-remaining: 599
< ratelimit-reset: 1603314428
< ratelimit-resettime: Wed, 21 Oct 2020 21:07:08 GMT
< gitlab-lb: fe-01-lb-gprd
< gitlab-sv: localhost
< cf-cache-status: DYNAMIC
< cf-request-id: 05ee94d4f20000ca4b95a1f000000001
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< server: cloudflare
< cf-ray: 5e5df0ce481cca4b-YUL
< 
* Connection #0 to host gitlab.com left intact
{"message":"404 Not found"}

Output of checks

This bug happens on GitLab.com

Edited by Vinay Mandy