You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I was successful at creating a new page in the Script Console using the authenticatedRequestFactory simular as follows..
def myResponse
//create page
authenticatedRequestFactory
.createRequest(Request.MethodType.POST, "rest/api/content")
.addHeader("Content-Type", "application/json")
.setRequestBody(new JsonBuilder(params).toString())
.execute(new ResponseHandler<Response>() {
@Override
void handle(Response response) throws ResponseException {
if(response.statusCode != HttpURLConnection.HTTP_OK) {
throw new Exception(response.getResponseBodyAsString())
}
else {
myResponse = new JsonSlurper().parseText(response.responseBodyAsString)["page"]["id"]
}
}
})
I have had a real problem trying to add a new attachment to the new page using "rest/api/content/{id}/child/attachment" as I cannot figure out how to add the file to the request as in the format above?
My goal is to create a new Confluence page with attachment for each Jira issue as a post function. Retrieving the attachment from the jira issue is not a problem..just adding it to the newly created confluence page stumps me.
Any help would be greatly appreciated!
I would really like to know this as well. Is there a parameter to be added? Did you figure this out, perhaps?
The goal here for me is to create a confluence page from a Jira ticket using the tickets description and tickets attachment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.