Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to insert an attachment link in a page using Confluence Command Line Interface.

...

  • addAttachment action: 

    Code Block
    themeMidnight
    --action addAttachment --space "SPACEKEY" --title "PAGETITLE" --file "./src/itest/confluence/resources/testing.mp3"


  • modifyPage action: modifyPage action is used to modify the current page content by adding content before(--content) or after current content(--content2) and applying findReplace logic (based on page content XHTML source).

    Code Block
    themeMidnight
    --action modifyPage --space "SPACEKEY" --title "PAGETITLE" --content "[ABC](https://bobswift.atlassian.net?xxx&yyyzzz=aaa)" --noConvert --markdown


  • storePage action: storePage action creates/updates a page. If the page with the mentioned title is not found then it creates a new page with the mentioned information given in the CLI command. If the page exists then it restores the page with the new information/content as per the CLI command given.

    Code Block
    themeMidnight
    --action storePage --space "SPACEKEY" --title "PAGETITLE" --content "[ABC](https://bobswift.atlassian.net?xxx&yyyzzz=aaa)" --noConvert --markdown


Info

In the above examples:

  • SPACEKEY is the space key and PAGETITLE is the title of the page. 
  • ./src/itest/confluence/resources/testing.mp3 is the path of the file to be attached to the page. You must change this file and path to reflect your required attachments.
  • Replace the URL with the Confluence attachment link (the URL that is displayed when you select the required attachment in Confluence attachments).
  • Replace ABC with the text that you want to display on the Confluence page for the attachment URL.
  • The output of the modifyPage and storePage examples is displayed as:


Info

https://bobswift.atlassian.net/wiki/spaces/SUPPORTS/pages/1102020786/How+to+add+an+attachment+link+in+a+page+using+CLI