Get 404 when trying to download 'latest artifact' with link

Im trying to download the latest artifact for a build, but dont seem to be able to create the correct url.

From the doc. the url should be like this:
https://example.com/<namespace>/<project>/-/jobs/artifacts/<ref>/download?job=<job_name>
example from doc:

https://gitlab.com/gitlab-org/gitlab/-/jobs/artifacts/master/download?job=coverage

the only thing i can see differs is that i have project with a format that is:

foo/qaz/baz

When i copy the url from the GitLab portal that works, but its tied to the job-id, so when i switch out the id with branch name it stops working.

This is the url from the portal downloading artifact from a job with job-id:
https://gitlab.com/orgname/foo/qaz/baz/-/jobs/123456/artifacts/download
This works

So the url i thought ended up with that isnt working is:
https://gitlab.com/orgname/foo/qaz/baz/-/jobs/artifacts/test/download?job=build
This gives a 404 error

It looks like I’m having the same issue with my project.

I just found this issue that sounds related url to download the artifact of the latest build does not download the latest one. (#20230) · Issues · GitLab.org / GitLab · GitLab

Update ! I found the solution to my problem.

I have a pipeline with manual action and the manual action wasn’t done. It need to manual action to be done. It means the full full pipeline need to be successful.

Hopefully this comment will help.