how to create hashtag for a gerrit cahnge from ssh?

238 views Asked by At

I wanted to create hashtag using ssh gerrit command. Example: i tried below

ssh -p 22 server.com gerrit  set-reviewers --add  "#bugfix" 123455

its giving error account bugfix not found

also tried , --addhashtag, saying no such option.

gerrit query on gerrit webpage search working with

hashtag:NAME

but not finding way to apply tag from automations, don't want to go for curl commands or API.

tried all options from chatGPT

1

There are 1 answers

0
Marcelo Ávila de Oliveira On

You can't add hashtags using the "gerrit set-reviewers" command, use the API to do that instead:

curl --user USER:PASS --request POST  --data @- --header Content-Type:application/json https://GERRIT-SERVER/a/changes/CHANGE-NUMBER/hashtags << EOF
{
    "add": [ "bugfix" ]
}

See more information in Gerrit documentation here.