Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to add label from command line?

AJ_junichi June 26, 2021

I deleted a label by executing following from windows command line

curl -X DELETE -u myname@domain:aaaaJyjTW5ELIcZmZd1fQ6F65 "https://domain.atlassian.net/wiki/rest/api/content/942768148/label?name=label_to_delete

 

I want to add a label in a similar manner. My attempt was to execute following but this does not work. 

curl -X POST -u myname@domain.com:aaaajTW5ELIcZmZd1fQ6F65 "https://domain.atlassian.net/wiki/rest/api/content/1004568706/label" --data "[{"prefix":"global", "name": "section_a"}]" -H "X-Atlassian-Token: no-check"

1 answer

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 28, 2021

Hello,

Happy to help ensure the endpoint is accessible and returning the correct results. To understand what aspect isn't working, could you please either send over the error message to include a (sanitized) screenshot of the output?

Another option would be to run a GET on a page with labels to review the JSON formatting there to ensure what you have matches. 

GET /wiki/rest/api/content/{id}/label  OR GET /wiki/rest/api/content | See Expand metadata.labels 

Regards,
Stephen Sifers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events