@Steven Behnke I am looking to add an Issue Collector to my Confluence Page (single page), I am running Confluence 3.5.11 and JIRA 6.3.12.
The issue collector is set up for custom and I went to my confluence page and inserted the HTML macro you pasted above (replacing my url for src)
{html} <script> AJS.toInit(function(){ AJS.$('.aui-header-primary .aui-nav').append('<li><a href="#" id="myIssueTrigger" class="aui-button aui-style aui-button-primary aui-nav-imagelink">Bug Report</a></li>'); }); </script> <script type="text/javascript" src="http://jira/s/0c13895773c11edccb53ae66c985466f-T/en_US83oybm/6343/12/1.4.16/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js&collectorId=8f47a897"></script> <script type="text/javascript">window.ATL_JQ_PAGE_PROPS = { "triggerFunction": function(showCollectorDialog) { //Requires that jQuery is available! //Use whatever ID you used on your Button/Trigger //In this case, I used id="myIssueTrigger" in the Button/<a> element //So I must use #myIssueTrigger here jQuery("#myIssueTrigger").click(function(e) { e.preventDefault(); showCollectorDialog(); }); }};</script> {html}
After I save I see nothing on the page that is different. I have attached a photo (I had to color out the tree for this page on the left and our logo) but I am not sure where I should see this button.
Capture.JPG
I have tried using the method described in the wiki from Atlassian and I did not see the button either.
Hi Jeremy, thanks for opening a new question. The reason my other answer (https://answers.atlassian.com/questions/31654942) doesn't work for you is because of the difference in Confluence versions. My how-to was written for Confluence 5+, specifically Confluence 5.7.4. Things certainly have changed since Confluence 3.X.
I chose a simple route of appending the "Bug Report" button to the big Create button at the top of the screen like so – AJS.$(
'.aui-header-primary .aui-nav'
).append(
'<li><a href="#" id="myIssueTrigger" class="aui-button aui-style aui-button-primary aui-nav-imagelink">Bug Report</a></li>'
);
image2016-2-26 13:22:9.png
This Create button doesn't exist in your version of Confluence! Your code isn't finding anything to append to. Further, the AUI pack doesn't exist here either. We should use classes that Confluence is using in our version.
image2016-2-26 13:23:53.png
Instead, let's prepend it to the Browse menu with a menu-item.
AJS.$('#header-menu-bar').prepend('<li class="normal ajs-menu-item"><a href="#" id="myIssueTrigger">Bug Report</a></li>');
image2016-2-26 13:35:40.png
If you wanted a button on the page, you could use <button id="myIssueTrigger">Bug Report</button>
instead of all this prepending/appending nonsense.
image2016-2-26 13:38:55.png
Honestly a button would be much easier. I am not good with javascript/html so I apologize if I ask a bunch of questions.
To add the button would I just replace the append/prepend script with the button code?
{html} <script> <button id="myIssueTrigger">Bug Report</button> </script> <script type="text/javascript" src="http://jira/s/0c13895773c11edccb53ae66c985466f-T/en_US83oybm/6343/12/1.4.16/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js&collectorId=8f47a897"></script> <script type="text/javascript">window.ATL_JQ_PAGE_PROPS = { "triggerFunction": function(showCollectorDialog) { //Requires that jQuery is available! //Use whatever ID you used on your Button/Trigger //In this case, I used id="myIssueTrigger" in the Button/<a> element //So I must use #myIssueTrigger here jQuery("#myIssueTrigger").click(function(e) { e.preventDefault(); showCollectorDialog(); }); }};</script> {html}
If that is the case I am still not seeing anything on confluence page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Close: Don't put a HTML element in script tags – It's not javascript anymore, we're just adding an HTML button.
{html} <button id="myIssueTrigger">Bug Report</button> <script type="text/javascript" src="http://jira/s/0c13895773c11edccb53ae66c985466f-T/en_US83oybm/6343/12/1.4.16/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js&collectorId=8f47a897"></script> <script type="text/javascript">window.ATL_JQ_PAGE_PROPS = { "triggerFunction": function(showCollectorDialog) { //Requires that jQuery is available! //Use whatever ID you used on your Button/Trigger //In this case, I used id="myIssueTrigger" in the Button/<a> element //So I must use #myIssueTrigger here jQuery("#myIssueTrigger").click(function(e) { e.preventDefault(); showCollectorDialog(); }); }};</script> {html}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good news is I have a button now but it is not firing the javascript to launch the issue collector
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No problem! Good luck, ask questions if you never need anything! I'm around from time to time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First of all, thank you Steven for all the time you've invested on this topic.
I have the same issue - the button is showing up fine but the JS is not firing.
Appreciate your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.