Create a page in Confluence under named parent from Script runner in Jira

James Mears September 17, 2018

Background Info: Hey guys, I'm using Scriptrunner in Jira currently.  I seek to create a page in Confluence, with a specific parent, when an issue is created in Jira under a page based on the name of the issue and a few custom fields.  Depending on the name/custom fields, the parent will be different.

Question:  Does anyone know of a way to do a search for a Confluence page by name in a Scriptrunner for Jira Script to get the page ID?  I am able to do this via the Confluence REST API and have confirmed it works with Postman.  But I don't know how to do it in Jira Scriptrunner, I can't find any code on here that actually works when I paste it into the Script Console.  Any solution where I can get the Confluence page ID from Scriptrunner will work for me. (I can't hardcode the page ID's in) that will NOT work for me.  If that is not possible, does anyone know a way to specify the parent of a page by TITLE in script runner for Jira?

1 answer

0 votes
Aidan Derossett [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.
September 24, 2018

Hey there James!

We have a couple of pages in our SR for JIRA and SR for Confluence documentation that should be of some help in this scenario.

In our Interacting with Confluence from JIRA page (and the other pages under that section), we discuss the use-cases that you mention above.

After looking those over, let me know if you'd like me to elaborate on anything or if you need any help. :D

Best,
Aidan

James Mears October 1, 2018

I ended up figuring this out.  Thanks Aidan!

Aidan Derossett [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.
October 1, 2018

Good stuff! Glad you were able to get it worked out :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events