SINCE V1.3.0
You need to Database Connection Configuration to be able to retrieve data from correct database.
Steps
- Create a new Confluence page or edit an existing Confluence page
- Insert SVG Chart Macro
- Insert a code block macro inside the SVG Chart Macro
Edit the code block macro and choose SQL in the syntax highlighting field. (Currently only support SQL query statement starting with select )
- Edit the code block macro, fill in the database name into the title field of code block macro. If the database name is not provided, the first available database will be used.
SQL Example
Issue count group by Project and Issuetype:
Confluence
select s.spacename as 'Space Name',count(case when contenttype='PAGE' then contenttype else null end) as Page, count(case when contenttype='ATTACHMENT' then contenttype else null end) as Attachment from CONTENT c join SPACES s on c.spaceid=s.spaceid JOIN SPACEPERMISSIONS sp ON s.spaceid=sp.spaceid where sp.PERMALLUSERSSUBJECT is null and sp.PERMGROUPNAME is null and sp.PERMUSERNAME is null group by s.spacename;
spacename | page | attachment |
---|---|---|
Atlassian Workshop 活动 | 2 | 6 |
Atlassian 产品试用 | 36 | 119 |
Atlassian产品资料中心 | 257 | 578 |
INFOR 知识库 | 17 | 39 |
Jira Software中文手册 | 54 | 0 |
Parallel Approval Process for JIRA | 38 | 74 |
SVG Chart Macro for Confluence | 24 | 36 |
快速入门 | 247 | 536 |
演示 | 135 | 245 |
自研插件 | 50 | 122 |
视频资料 | 13 | 7 |