Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,364,029
Community Members
 
Community Events
168
Community Groups

Need to add content, instead of updating the whole page while using API

Hi All,

I got a script output that needs to be uploaded on a page in my confluence space, once in a day. But every time it deletes the previous data. Is it possible to add insted of update.

 

Best regards.

 

1 answer

@Cihat KARAPINAR  could you please give a bit more information and/or show what you are coding right now to get this unwanted result? It is hard to say why it is not working without knowing what / how you are doing it.

tnx

Hi Andrea,

 

I have a powershell script. It returns a list of users and details from a specifig group. The script is running once in a day and the result can be zero or multiple lines. When script result is not null it calls a function. This function invoke a API call. In this API I can update my page but every update I lost my old data. I need to add lines and keep existing data.

 

Best regards.

example BODY for API

 

{
    "id""46596419",
    "type""page",
    "title""testapiburada",
    "space": {
        "key""SY"
    },
    "body": {
        "storage": {
            "value""<p>{variable's from script.}</p>",
            "representation""storage"
        }
    },
    "version": {
        "number"10
    }
}

 

you ARE using the AtlassianAPI, aren't you? you would have to call append_page() or prepend_page() to insert new content after/before the existing one.

 

If you are directly using post() you'll have to first extract the existing body, then concatenate old body and your new addition before you can post the complete content.

AltlassianConfluenceAPI really makes it much easier.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events