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.
Hi,
I use the rest api call to duplicate page hierarchy (parent & child pages) from a origin space to destination space.
curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/pagehierarchy/copy' \ --user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \ --header 'Content-Type: application/json' \
--data '{
"copyAttachments": true,
"copyPermissions": true,
"copyProperties": true,
"copyLabels": true,
"copyCustomContents": true,
"copyDescendants": true,
"destinationPageId": "<string>",
"titleOptions": {
"prefix": "<string>",
"replace": "<string>",
"search": "<string>"
}
}'
I use example from Confluence rest api catalog and in the part titleOptions it has 3 properties:
prefix --> I understand that I that to prefix title to allow to copy parent and child pages
Could you explain me what is the purpose of "Search" and "replace" properties?
Thank you
Cedric
Hello @CEDRIC DEVAUX
Those two properties are for searching and replacing words from the titles of the source pages when copying pages in the same space, since Confluence doesn't allow two pages in the same space to have the same title.
For example, if all the titles of the source pages contained the word "dogs" and you wanted all the titles of all the copied pages to use the word "cats" instead, you'd use:
"titleOptions": {
"search": "dogs",
"replace": "cats"
}
Combined with the prefix property, it gives you a bit more flexibility in ensuring pages copied into the same space have unique titles.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.