The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automating file upload to a page from a network drive

Дмитрий Пересекин
Contributor
July 20, 2020

Is it possible to somehow automate the upload of a file to the Confluence page?
Now the process is as follows: The page moderator enters edit mode, removes the old file from the page and adds a new one, then saves the page.
Is there a tool (possibly a separate development, e.g. SIL Script) to automate this process?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Dar Kronenblum
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 20, 2020

you can use script runner, I'm guessing something like that will work:

 def filePath ="file path"
File file = new File(filePath)
if (file.exists()){
InputStream targetStream = new FileInputStream(file);
Attachment att = new Attachment(imgName,"png", file.length(), "UML image");
att.setContent(page)
attachmentManager. saveAttachment(att,null, targetStream)
}
Дмитрий Пересекин
Contributor
July 21, 2020

Thanks for the answer, we will try.
Friends, if you have any more ideas, please write. Thank!

TAGS
AUG Leaders

Atlassian Community Events