CLI command for linking attachments

Hello everybody,

Does the Confluence Command line Interface provide a command for setting a link on a page to a attachment??

I tried the "addAttachment" but it just move the attachment to the page.

Greetings David

2 answers

This widget could not be displayed.

Not sure what you are trying to do, but, if you need to change the page source in any way (like adding links etc...), you need to use storePage. You can retrieve the existing source using getPageSource.

Would it be something like confluence.bat --action storePage --space "space" --title "title" --content "[data.png|This is a picture] ??^^

For example i load an attachement on a page with "--loadFiles". This Attachement can be downloaded if you click on the paperclip symbol but i want that the file is linked on that page. You know what i mean?

So how would i use the storePage command in this case? The parameters --space and --title are clear but what do i use for content/file ??

Ok that would work, but if i use the command --storePage the new content replaces the old one!

If I use "--storepage" with adding new content, the new content replaces the old one. Is it possible to just attach the new content after the old ??

Use getPageSource to get the existing source, append whatever you want, then storePage

This widget could not be displayed.

You could try https://github.com/leonardinius/atlassian-rest-cli to script it, if you are ok to script groovy code around Confluence API.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Tuesday in Confluence

Add-on evaluation with confluence templates

Atlassian market place contains number of Apps/Addons which improves the capability of out of the box Atlassian products. It is good to follow a plugin evaluation process before install add-ons. So t...

149 views 12 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you