IF you have tons of pages with de-activated owners in your Confluence org, with automation rule you can now run a scheduled task to update them with parent page owners (active ones of course).
AUTOMATION RULE: Updating page owners from Parent page
Description: If a child page has a de-activated owner, it gets updated with the parent page's active owner.
Scope: Single Confluence space (space ID)
TRIGGER
- Scheduled: weekly, every Thursday at 18:30 (Europe/Berlin)
FLOW
For each page in the space whose owner is a deactivated user:
1. Fetch page details
GET https://yoursite.atlassian.net/wiki/api/v2/pages/{{page.id}}
(Basic auth, Content-Type: application/json)
2. Create variable "PageVersion" = {{webResponse.body.version.number.plus(1)}}
(current page version + 1, needed for the later update)
3. Continue only if the response status = 200.
4. Continue only if {{webResponse.body.parentType}} = "page".
5. Create variable "parentPageId" = {{webResponse.body.parentId}}
6. Continue only if parentPageId is not empty.
7. Fetch parent page details
GET https://yoursite.atlassian.net/wiki/api/v2/pages/{{parentPageId}}
8. Create variable "parentOwnerId" = {{webResponse.body.ownerId}}
9. Look up the parent owner's user profile
GET https://yoursite.atlassian.net/wiki/rest/api/user?accountId={{parentOwnerId}}
10. Continue only if {{webResponse.body.accountStatus}} = "active".
11. Update the child page's owner
PUT https://yoursite.atlassian.net/wiki/api/v2/pages/{{page.id}}
Body:
{
"id": "{{page.id}}",
"status": "current",
"title": "{{page.title}}",
"ownerId": "{{parentOwnerId}}",
Natalia Lezhai
2 comments