Split page titles containing hyphens into separate values
Scenario
This recipe shows you how to split page titles containing hyphens into separate values and use them in separate columns of a table.
You can copy and paste this code into the target Confluence page:
{
"cql": "type=page and title ~ \"Meeting\"",
"filters": [],
"expansions": "content.history",
"reportInfos": [
{
"id": "2a699b1b-899f-4021-9b6e-9da7af1248e8",
"type": "text",
"title": "Meeting ID",
"value": "content.id",
"template": "{\"version\":1,\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"{% assign temp = content.title | split: ' - ' %} {{ temp[0] }}\"}]}]}"
},
{
"id": "850c5abf-41a3-4a22-8562-b4cd39033f10",
"type": "text",
"title": "Meeting Title",
"value": "content.id",
"template": "{\"version\":1,\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"{% assign temp = content.title | split: ' - ' %} {{ temp[1] }}\"}]}]}"
},
{
"id": "d21fa09b-811f-4fe0-98a5-0ef5545e1361",
"type": "text",
"title": "Created Date",
"value": "content.id",
"template": "{\"version\":1,\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"{% assign temp = content.history.createdDate | split: 'T' %} {{ temp[0] }}\"}]}]}"
},
{
"id": "1cca57bb-7258-4a36-b6c2-f1a4828a64a5",
"type": "basic",
"title": "Creator",
"value": "content.history.createdBy.displayName",
"template": "{\"type\":\"doc\",\"version\":1,\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"{{ content.history.createdBy.displayName }}\"}]}]}"
}
]
}
Result
Recipe
Apps | Reporting for Confluence Cloud |
---|---|
Level | Intermediate |
Estimated time | 20 minutes |
Notes
This recipe is now part of Reporting's built-in templates. You can easily load it into your page by using the templates feature.
By default, the report is limited to 200 results. Enable Get all results below the search box if you need to view more results.
Caveats
Hyperlinking is not yet implemented - may be implemented in future
Relies on Liquid split function to convert ISO 8601 date time to “YYYY-dd-mm” format
Copyright © 2023
• Powered by Scroll Viewport & Atlassian Confluence