Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,524
Community Members
 
Community Events
185
Community Groups

Create child page from template with prefilled title

Hello!
I have a parent page named "page 1".
On it I want to place the "Create from template" button.
At the same time, I need that when the "Create from template" button is pressed, a child page is created with a pre-filled title, for example (Documentation + page 1). That is, the title of the child page should automatically fill in the title with two variables, this is an arbitrary text + the title of the parent page.

What solutions are currently available? How can I implement it?

2 answers

0 votes
Jessie Wang_ScriptRunner_The Adaptavist Group
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Oct 14, 2022

Hi @Deniz Perz are you on an on-prem instance? If so you can achieve this with ScriptRunner for Confluence and our 'Create Page' macro as mentioned by Patrick above.

In our documentation, there is a short 1:30min video that will give you a demo of what the macro does. You can watch it to see if it meets your needs. https://docs.adaptavist.com/sr4c/latest/features/macros/built-in-macros/create-page.

ScriptRunner for Confluence is available for a 30-day free trial if are interested in testing it out. https://marketplace.atlassian.com/apps/1215215/scriptrunner-for-confluence?tab=overview&hosting=cloud

Any other questions feel free to ask!

Hi @Jessie Wang_ScriptRunner_The Adaptavist Group , I have ScriptRunner for Confluence (server) and exploring the possibilities with extending the "Create Page" macro by ScriptRunner.

My goal is to create a new page from a template while passing a custom variable $myVariable to the content body from page template. At the same time the page title uses $myVariable as a prefix.

 

1. Is it possible to create a custom class to extend the CreatePageMacro? I've not been able to succeed as described in Customising Macro Variables.  Do you have any code examples?  

2. Is it possible to grab a value from a table in a current Confluence and pass it on to CreatePageMacro? 

otherwise,

3. Can the value from <Prompt Title> in "Create Page" macro be passed to a page template?

0 votes
Patrick Vanhoof
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.
Oct 14, 2022

I do not think this is possible with the 'Create from template' macro.

We have the Scriptrunner for Confluence add-on, that has a 'create page' macro with lots of possibilities.

Hi @Patrick Vanhoof, do you know I can create a new page from a template while passing a custom variable $myVariable to the template to generate content? At the same time the page title uses $myVariable as a prefix, how can this be done without having to enter the value twice for $myVariable?  Can this be achieved using the "Create Page" macro by ScriptRunner ?

Patrick Vanhoof
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.
Nov 24, 2022

@Marianne Lee , the variable in the template works as with the create from template macro, you get a screen first where you enter the variabler value.

But as far as I can see, the use of that variable in the Create page macro is not possible. Correct, @Jessie Wang_ScriptRunner_The Adaptavist Group ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events