Scriptrunner on JIRA Cloud - Creating Confluence Page on Post Function

Randy
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 Leaders.
April 19, 2017

Hi Everyone,

I'm using ScriptRunner on JIRA Cloud and Confluence Cloud.

Is it possible to create a confluence page as the initiating user using ScriptRunner's post function script?

 

I tried posting to /wiki/rest/api/content/ and am getting a 403.  Would like to avoid putting credentials in my script.

put("/wiki/rest/api/content")
.header("Content-Type", "application/json")
.body(params)
.asString()

params is just my json array

{
  "type": "page",
"title": "Autogenerated Page", "space": {"key":"SANDBOX"}, "body": { "storage": { "value": "<p>Hello world!</p>", "representation": "storage" } } }

Thanks!

1 answer

1 accepted

0 votes
Answer accepted
Jon Mort [Adaptavist]
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 Leaders.
April 26, 2017

Hi Randy,

First, thanks for using ScriptRunner for JIRA Cloud.

Right now we don't have Confluence support. Our plan is to launch ScriptRunner for Confluence Cloud but we have no launch date.

We are also working on a way to store encrypted variables to inject into scripts so they are not stored in the clear anywhere. We have the backend implemented and the frontend will be coming shortly. The purpose of the feature is to allow script authors to use credentials or API keys without them being in the clear anywhere. Realistically this feature will not be ready for a few weeks so the best I can suggest is hard coding credentials for now and then resetting them and updating once we launch the feature, or waiting until we launch.

Regards,

Jon

Randy
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 Leaders.
May 4, 2017

Thanks Jon.

Those upcoming features look like what we'll need to accomplish this.  We'll probably hold off automating this part of our workflow until after you release.

Looking for any beta testers? ;)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events