使用 curl 命令将工件从一个存储库提升到另一个存储库失败

Promote an artifact from one repo to another fails using curl command

我正在尝试使用此 curl 命令将 multi configuration Jenkins 构建从一个存储库提升到另一个存储库:

curl -H Content-Type:application/json -X POST -d '{"status":"released","sourceRepo":"repo-promoted","targetRepo":"repo-released"}' http://artifactory/api/build/promote/build.name/144

但是我得到这个错误:

message Cannot find builds by the name 'build.name' and the number '144'.

description The requested resource is not available.

构建存在(即 "builds" 部分中有一个 link)。知道是什么原因造成的吗?我需要在某处指定配置标签吗?

解决方案是指定父作业名称,以及带有提升构建标签(配置)的提升构建编号,并按如下方式替换空格:

<parent.job.name>/$PROMOTED_NUMBER%20::%20BUILDMODE=$buildmode,label=$nodeName