If you want create new Confluence page programmatically, the best way is use CLI for Confluence, an Addon by Bob Swift. It can help to send command to your Confluence Instance (server or cloud) without any problem 🙂

 

What is CLI?

CLI stand for Command Line Interface and it’s a set of command we can use to pilot own Atlassian products instance.

How it works?

This addon is formed by two part:

  • an addon for the Atlassian product (Confluence, Jira, Bitbucket, and so forth), which extents the API set;
  • a client part to download on Atlassian Server, as shown on previous image, which calls the new API.

 

What we can do?

The answer is easy: everything. We can:

  • add a new page/new blog post
  • add an attachment to existent page
  • add a comment
  • add and application link
  • and so forth

An example please?

This is a simple usage. Putting  a list of page inside a text file, we can use it as a cursor to create programmatically a list of pages 😀

use this simple bash code:

 

#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
 ./confluence.sh --server http://localhost:8090 --user  --password "password" --action addPage --space "TEST" --title $line --content "This is a content"
done < "$1"

to create pages 🙂

By Fabio, Artigiano del Software in MrAddon

Advertisements
Posted by:artigianodelsoftware

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s