Creating a survey system in Confluence
- Li Xuan Liew (Deactivated)
- Robert Alexander Marshall
Overview
As a Confluence administrator, you may want to conduct a survey and want to be able to see some statistical analysis and charts into the dashboard. In the other hand, as a quality assurance engineer you want to see the suggestions provided by respondents.
This use case shows you how to build an all-in-one complete one-stop solution using
Ingredients
Confluence apps
You will need the following Appfire apps installed on your Confluence.
You will also need the following third-party app installed.
Full source code
The following source code is shared using Confluence Storage Format. This the XHTML-based format that Confluence uses to store the content of pages, page templates, blueprints, blog posts and comments.
For more information on how to use this source code on your Confluence, read the following article - How do I use Recipes that use the Storage Format with the Confluence Source Editor?
<ac:layout>
<ac:layout-section ac:type="three_equal">
<ac:layout-cell>
<p>
<ac:emoticon ac:name="information"/> Create your survey here:<br/>
<br/>
</p>
<table class="wrapped">
<colgroup> <col/> </colgroup>
<tbody>
<tr>
<th style="text-align: right;">
<div class="content-wrapper">
<p>
<ac:structured-macro ac:macro-id="d4bd617e-7809-4a24-bc13-a7f924c3318b" ac:name="add-page" ac:schema-version="1">
<ac:parameter ac:name="name">Survey %child-counter:next > number:000%</ac:parameter>
<ac:parameter ac:name="linkText">Create Survey</ac:parameter>
<ac:parameter ac:name="source">Survey</ac:parameter>
<ac:parameter ac:name="live">true</ac:parameter>
</ac:structured-macro>
</p>
</div>
</th>
</tr>
</tbody>
</table>
</ac:layout-cell>
<ac:layout-cell>
<p>
<br/>
</p>
</ac:layout-cell>
<ac:layout-cell>
<p style="text-align: center;">
<br/>
</p>
</ac:layout-cell>
</ac:layout-section>
<ac:layout-section ac:type="single">
<ac:layout-cell>
<p>
<br/>
</p>
</ac:layout-cell>
</ac:layout-section>
<ac:layout-section ac:type="two_equal">
<ac:layout-cell>
<ac:structured-macro ac:macro-id="a54539ad-bc43-4ccf-bc58-085d0bde39d5" ac:name="show-if" ac:schema-version="1">
<ac:parameter ac:name="user">
<ri:user ri:userkey="2c91808357cb99ba0157cbcea4030004"/>
</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<ac:emoticon ac:name="information"/> As <strong> Admin </strong>you can see the survey report. Try to login as <strong>Quality Assurance Engineer </strong>to see a different view on this page.<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="3123962b-52e0-4aa3-a572-570fb83724b9" ac:name="panel" ac:schema-version="1">
<ac:parameter ac:name="bgColor">#00B8D9</ac:parameter>
<ac:parameter ac:name="borderWidth">0</ac:parameter>
<ac:rich-text-body>
<h2 style="text-align: center;">
<span style="color: rgb(51,51,51);">Surveys created in the last 24h</span>
</h2>
<ac:structured-macro ac:macro-id="5ce2d14b-3234-4e66-8a0c-2ea0078cf45b" ac:name="report-block" ac:schema-version="1">
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="1f91ea42-55d5-4bbd-8210-ac7b8038b9fe" ac:name="local-reporter" ac:schema-version="1">
<ac:parameter ac:name="">page:children</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="78391abf-0a96-462c-ab75-048a279ff564" ac:name="date-filter" ac:schema-version="1">
<ac:parameter ac:name="minValue">-1d</ac:parameter>
<ac:parameter ac:name="">content:creation date</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="b81d9955-cac0-48b2-b439-fdd12ebcaeb0" ac:name="report-header" ac:schema-version="1">
<ac:rich-text-body>
<h1 style="text-align: center;">
<span style="color: rgb(51,51,51);"> <ac:structured-macro ac:macro-id="639aa3c0-cc0d-4a80-9ba7-01bb65e0f585" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="">report:query>collection:size</ac:parameter>
</ac:structured-macro> Surveys</span>
</h1>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="7f12049d-f107-4f44-8c47-fff669a74a2c" ac:name="report-body" ac:schema-version="1">
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="9ca89724-cee8-4f46-952d-2102941a193d" ac:name="hidden-data" ac:schema-version="1">
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<h1>
<span style="color: rgb(51,51,51);"> <ac:structured-macro ac:macro-id="6297c13e-0f4a-40f1-a13b-8623e5310f95" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="">content:title</ac:parameter>
</ac:structured-macro> </span>
</h1>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="93ca1aec-1602-4433-8e2b-b235432eecc2" ac:name="report-empty" ac:schema-version="1">
<ac:rich-text-body>
<h1 style="text-align: center;">
<span style="color: rgb(51,51,51);">0 Surveys</span>
</h1>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="11da525b-c120-453a-b21f-35a4933d4345" ac:name="table-chart" ac:schema-version="1">
<ac:parameter ac:name="innerlabels">Percentage</ac:parameter>
<ac:parameter ac:name="dataorientation">Vertical</ac:parameter>
<ac:parameter ac:name="legend">right</ac:parameter>
<ac:parameter ac:name="column">Rating</ac:parameter>
<ac:parameter ac:name="aggregation">Rating</ac:parameter>
<ac:parameter ac:name="is3d">true</ac:parameter>
<ac:parameter ac:name="align">Center</ac:parameter>
<ac:parameter ac:name="separator">Point (.)</ac:parameter>
<ac:parameter ac:name="version">3</ac:parameter>
<ac:parameter ac:name="colors">#3572b0,#8eb021,#d04437</ac:parameter>
<ac:parameter ac:name="datepattern">dd M yy</ac:parameter>
<ac:parameter ac:name="pieKeys">5 - Very good‚4 - Good‚3 - Neither good nor poor</ac:parameter>
<ac:parameter ac:name="id">1568191057072_-740217408</ac:parameter>
<ac:parameter ac:name="worklog">5|8|w d h m|w d h m</ac:parameter>
<ac:parameter ac:name="formatVersion">3</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="3fb6254a-1e6e-47ef-8647-3b6974290219" ac:name="report-table" ac:schema-version="1">
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="889ed87f-6b7f-47c5-839f-2e5bdbe33894" ac:name="local-reporter" ac:schema-version="1">
<ac:parameter ac:name="">page:children</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="0bd6db7e-3b1b-4ff5-92fe-067f75b3f870" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Rating</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="46240190-07b1-43ec-9fe5-03a6bfcbac1b" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="">data:rate</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="9ce5566a-8747-4493-985c-984f29781944" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Suggestions</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="107aea77-5fa7-4561-b6fc-9e3c240a42dc" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="render">richtext</ac:parameter>
<ac:parameter ac:name="">data:comment</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
</ac:layout-cell>
<ac:layout-cell>
<p>
<br/>
</p>
</ac:layout-cell>
</ac:layout-section>
<ac:layout-section ac:type="three_equal">
<ac:layout-cell>
<p>
<br/>
</p>
</ac:layout-cell>
<ac:layout-cell>
<p>
<br/>
</p>
</ac:layout-cell>
<ac:layout-cell>
<p>
<br/>
</p>
</ac:layout-cell>
</ac:layout-section>
<ac:layout-section ac:type="single">
<ac:layout-cell>
<ac:structured-macro ac:macro-id="717ffb7b-d521-44ed-b22b-e606f64e99cc" ac:name="show-if" ac:schema-version="1">
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:parameter ac:name="group">quality-assurance</ac:parameter>
<ac:rich-text-body>
<ac:emoticon ac:name="information"/> As <strong>Quality Assurance Engineer </strong>you can see the list of suggestions from the survey but not the full report. Login as <strong>Admin</strong> to see the survey report.<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="6b3975f6-bf27-49be-a14f-8dbc3d678d67" ac:name="report-table" ac:schema-version="1">
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="c2f9a5d4-1de2-42a2-b737-215494d89dcc" ac:name="local-reporter" ac:schema-version="1">
<ac:parameter ac:name="">page:children</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="944ce947-6602-4b1e-bb1e-c1e0aa277140" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Suggestions</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="da42849e-ab87-4546-b748-110382b605fe" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="render">richtext</ac:parameter>
<ac:parameter ac:name="">data:comment</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<p>
<br/>
</p>
</ac:layout-cell>
</ac:layout-section>
</ac:layout>
Building this use case
Complete macro structure