curl 如何使用gerrit查询API查询一个JIRA问题

6ovsh4lw  于 2022-11-13  发布在  其他
关注(0)|答案(1)|浏览(279)

我想查询一个问题,比如说JIRA-123,下面的命令正是我想要的:

https://gerrit.mydomain.com/q/JIRA-123

我试着用下面的命令来做,但是它搜索的是字符串JIRA-123:

ssh -p 29418 user1@gerrit.mydomain.com gerrit query --format JSON --current-patch-set JIRA-123

与“www.example.com“等效的gerrit查询api命令是什么https://gerrit.mydomain.com/q/JIRA-123

z18hc3ub

z18hc3ub1#

请使用以下命令:

curl --user USER:PASS --request GET  https://GERRIT-SERVER/a/changes/?q=JIRA-123

auth=$(echo -n USER:PASS | base64)
curl --header "Authorization: Basic $auth" --request GET https://GERRIT-SERVER/a/changes/?q=JIRA-123

相关问题