How to create a confluence page using a template from jira via REST API

Bhupesh Nagda
Contributor
November 23, 2017

In case we have a template in confluence and want to create the page using the template then how should the template be passed in the API call?

Also how can I copy the URL of the page inside the JIRA ticket(maybe in description)? so that user can access the page directly from JIRA after it is created.

 

Thanks:)

4 answers

1 accepted

1 vote
Answer accepted
Bhupesh Nagda
Contributor
January 16, 2018

I was able to figure this out. You need to pass the template as an inline xml within html inside pageBody parameter. It worked for me. I wish there was a structured way of doing this but this is working for me as of now !

brbojorque
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 11, 2018

@Bhupesh Nagda

Can you post your example code man?

Bhupesh Nagda
Contributor
July 12, 2018

Hi,

For me it's a huge line of code, maybe you can mention where you are stuck or need help.

This documentation is helpful.

[link|https://scriptrunner.adaptavist.com/latest/jira/interacting-with-confluence-from-jira.html]

 

BR,

Bhupesh

Sam
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 8, 2020

Hi,

How do you copy a huge storage format to run by scriptrunner?

 

Thanks!

Pankaj Mehta
Contributor
September 28, 2023

Hi @Bhupesh Nagda 

When I run the code from script console, the output is coming as null and not creating confluence page.

So, could u please tell me where i am doing wrong?

Thanks

3 votes
brbojorque
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2018

@Bhupesh Nagda, can you post your solutions here please, for the sake of other people.

0 votes
Najjar _Innovura_
Atlassian Partner
June 14, 2020

Hi Bhupesh

We launched a new app that allows you to create pages from templates through Jira Workflow post-function and store the Confluence page in a Jira customfield to apply more actions like:

Workflow postfuntions

  • Update page permissions
  • Update page content
  • Update page title

Workflow conditions

  • Check if page was modified after a certain status transition
  • Check if page still has a placeholder

And so much more.

Please give it a try, I believe it would streamline alot of repeated effort on your team

Jira Confluence Workflow Extensions (JCWE) 

Give it a try I am confident you'll love it.

If you have any inquires or requests please drop me an email at admin@innovura.io

0 votes
Daniel Yelamos [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.
November 24, 2017

Hell Bhupesh!

You sir, need to look at our documentation!

As you can see this is covered in this article!

Hope that read helps you out. If it doesn't, let me know.

Cheers!

DYelamos

ABRAR ALI October 7, 2020

Hi @Daniel Yelamos [Adaptavist] 

I was able to create a basic page from the article listed by you.

Can you please tell me how to create a page from a template ? 

Regards

Abrar

Pankaj Mehta
Contributor
September 28, 2023

Hi @ABRAR ALI 

How you were able to create a confluence page through that article, i am getting an error in script console when I run the code?

could u please tell me from where we should execute the code ?

Thanks.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events