I'm using the Jira "Issue Collector" plugin to collect feedback on Confluence pages.

The embedded Javascript works fine in the global Custom HTML, but I'd like to make this space-specific.

I tried adding the Javascript to the Header and Footer sections in the Documentation Theme configuration, but no dice.

Any suggestions?

7 answers

Hi, Dave!

You can create a custom feedback forum and submit requests from it via email using Customer Case add-on for JIRA Cloud. In addition, you can also open the customer portal to your customers and users, so they can quickly browse the existing ideas and vote for them.

This will allow you to get a quick picture of your real customers' demands. 
You can learn the details here: https://stiltsoft.customercase.com/forums/customer-case-for-jira/ideas/2800-add-support-for-widgets 

How I did this is as follows:

New macro: x-issue-collector:

##
## Developed by: My Name
## Date created: dd/mm/yyyy
## Installed by: My Name

## @noparams
<script type="text/javascript" src="http://yoursite/s/en_USodxtav/772/3/1.1/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?collectorId=6d939084"></script>
</script>

Then in the skin (we used RefinedWiki, so in their Space footer or anywhere similar that takes a macro):

{x-issue-collector}

Seems to work in the RefinedWiki only if you are logged out, while it works in the standard theme also when you are logged in (at least in our version/configuration).

Just in case someone is also trying to get the issue collector running - check if it works if you are not logged in ... :)

Well, actually the feedback button was hidden behind the right toolbox. If the window is small enough that the toolbox is withdrawn, the feedback button gets into the view.

Since the toolbox is not shown for anonymous users I was mistaken to think that the login status has something to do with it: It does not.

Hey Dave,

You could put the JavaScript in an HTML macro on a space. The user would have to navigate to that page to use the collector, but it could be specific to pages or spaces that way.

-Simon

Thanks, Simon. We have 4 spaces in which we're particularly interested, and the spaces average 300 pages each. Adding the snippet per-page would be pretty tedious; I'm looking for a way to add a space-specific snippet to all the pages in each of those four spaces. The four spaces all use the Documentation theme, so I thought the footer customization would be perfect, but the Javascript doesn't get run - it just shows up in the footer as if it were text. I also tried wrapping the Javascript in {html} macros, to no avail.

Did you enable the HTML macro ??

Yes. Embedded directly in a page, the Javascript snippet works fine when surrounded by the HTML macro.

In the Header or Footer customization fields in the Documentation Theme configuration, however, the Javascript just gets passed through to the rendered screen; it doesn't get run. Same results whether surrounded by the HTML macro or not.

Yes, the HTML macro is enabled.

Hi Dave,

Can you check if the script is included in a correct script block, e.g.

<script type="text/javascript">
//<![CDATA[

-- your code here --

//]]>
</script>

Would it be possible to paste your snippet?

An other way to make it work is to include it in the site-wide custom HTML (this works fine for me).

Regards,

Tom

Hi Tom - when pasted into the Doc Theme's footer, the snippet shows up in the page source code like this:

&lt;div id="theme-footer"&gt;
            script type="text/javascript" async src="http://10.38.160.150/s/en_US6rouvu/665/2/1.0.23-beta/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?collectorId=1289abf5"&gt;&lt;/script&gt;
        &lt;/div&gt;

It works fine in the site-wide custom HTML; what I'm trying to do is get space-specific snippets, so I can log issues into different Jira projects, based on space.

1 vote
David Simpson Community Champion Apr 18, 2012

If you're using the Documentation theme and having problems with the footer, why not create a user macro then embed that into the footer.

e.g. this user macro placed in the footer will manage to cause absolute annoyance:

&lt;script&gt;
  alert(' +++++ $space.key $space.name +++++ ');
&lt;/script&gt;

The javascript runs though, so it's a step forward for you. You can likely adapt it to your needs.

Thanks, David! I'll give that a try.

Bummer... that approach didn't work, either. I tried wrapping the user macro in {html} macros, both in the user macro definition, and in the call to the user macro in the Doc Theme footer. I also tried the "Generates HTML" and "Generates Wiki Markup" user macro settings.

Nothing seems to run the script when the page renders.

I found that wrapping the Issue Collector generated script with additional script tags helped the user macro get executed rather than rendered as html.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

1,159 views 22 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you