Issue links API doesn't support encoded project paths for target_project_id

It appears that while we support encoded project IDs for :id, e.g., gitlab-org%2Frelease%2Ftasks, we don't support it for the target_project_id parameter:

release-tools master % http POST 'https://gitlab.com/api/v4/projects/gitlab-org%2Frelease%2Ftasks/issues/618/links' \
  Private-Token:`cat ~/.config/gitlab/rspeicher.production` \
  target_project_id=gitlab-org%2Frelease%2Ftasks \
  target_issue_iid=617
HTTP/1.1 404 Not Found
Cache-Control: no-cache
Content-Length: 35
Content-Type: application/json
Date: Thu, 10 Jan 2019 17:32:48 GMT
RateLimit-Limit: 600
RateLimit-Observed: 4
RateLimit-Remaining: 596
RateLimit-Reset: 1547141628
RateLimit-ResetTime: Fri, 10 Jan 2019 17:33:48 GMT
Server: nginx
Vary: Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Request-Id: dB7qyyjVU74
X-Runtime: 0.098255

{
    "message": "404 Project Not Found"
}

release-tools master % http POST 'https://gitlab.com/api/v4/projects/gitlab-org%2Frelease%2Ftasks/issues/618/links' \
  Private-Token:`cat ~/.config/gitlab/rspeicher.production` \
  target_project_id=5064907 \
  target_issue_iid=617
HTTP/1.1 409 Conflict
Cache-Control: no-cache
Content-Length: 39
Content-Type: application/json
Date: Thu, 10 Jan 2019 17:33:11 GMT
RateLimit-Limit: 600
RateLimit-Observed: 1
RateLimit-Remaining: 599
RateLimit-Reset: 1547141651
RateLimit-ResetTime: Fri, 10 Jan 2019 17:34:11 GMT
Server: nginx
Vary: Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Request-Id: DqqqezZQJP1
X-Runtime: 0.111711

{
    "message": "Issue(s) already assigned"
}

release-tools master % http POST 'https://gitlab.com/api/v4/projects/gitlab-org%2Frelease%2Ftasks/issues/618/links' \
  Private-Token:`cat ~/.config/gitlab/rspeicher.production` \
  target_project_id=gitlab-org/release/tasks \
  target_issue_iid=617
HTTP/1.1 409 Conflict
Cache-Control: no-cache
Content-Length: 39
Content-Type: application/json
Date: Thu, 10 Jan 2019 17:33:22 GMT
RateLimit-Limit: 600
RateLimit-Observed: 2
RateLimit-Remaining: 598
RateLimit-Reset: 1547141662
RateLimit-ResetTime: Fri, 10 Jan 2019 17:34:22 GMT
Server: nginx
Vary: Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Request-Id: nCK8FM7Z837
X-Runtime: 0.091663

{
    "message": "Issue(s) already assigned"
}
Edited Jul 02, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading