multiple issue collectors not working

Daniel Deeds April 1, 2016

Tried looking for an answer but nothing came up. I'm trying to use multiple issue collectors on the same page but it doesn't seem to work. They both work separately so I know the issue collectors themselves work as expected; however, trying to use them on the same page and they don't work

<a href="#" id="bod1" class="padded">BoD 1 test</a><br>
<a href="#" id="bod2" class="padded">BoD 2 test</a>

<script>
    $(document).ready(function(e) {
        window.ATL_JQ_PAGE_PROPS = $.extend(window.ATL_JQ_PAGE_PROPS, {
            '<COL1>' : {
                triggerFunction : function( showCollectorDialog ) {
                    $('#bod1').click( function(e) {
                        console.log("id bod1 clicked");
                        e.preventDefault();
                        showCollectorDialog();
                    });
                }
            }
            , '<COL2>' : {
                triggerFunction : function( showCollectorDialog ) {
                    $('#bod2').click( function(e) {
                        console.log("id bod2 clicked");
                        e.preventDefault();
                        showCollectorDialog();
                    });
                }
            }
        });
    });
</script>

This is my current code,i've also tried without the "= $.extend(window.ATL_JQ_PAGE_PROPS," and putting the triggerFunction in quotes but it doesn't work either way. Like i said putting them normally one at a time works it's just this multiple issue collector that isn't working. They aren't attaching to the links (according to fireBug smile).

I am placing the script link they give on the JIRA collector page just left it out and changed the name here for client security concerns.

They are using JIRA 6.0.5, double checked the archived doc but it's the same syntax as the new one so not sure why it isn't working

 

2 answers

0 votes
Zach Crittendon August 25, 2016

I had the same issue, but was finally able to get it working. The trick was to include the JIRA script for each collector, rather than just a single script. Here's sample code:

<script type="text/javascript" src="https://YOUR-JIRA-SERVER/s/abc123xyz-T/en_USabcd/64027/25/1.4.27/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=en-US&collectorId=1234"></script>
<script type="text/javascript" src="https://YOUR-JIRA-SERVER/s/abc123xyz-T/en_USabcd/64027/25/1.4.27/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=en-US&collectorId=5678"></script>
<script type="text/javascript">
$(document).ready(function() 
{
	window.ATL_JQ_PAGE_PROPS =  $.extend(window.ATL_JQ_PAGE_PROPS,
	{
		// Report a Bug 
		'1234' :
		{        
			"triggerFunction": function(showCollectorDialog)
			{
				jQuery("#trigger-1234").click(function(e) 
				{
					e.preventDefault();
					showCollectorDialog();
				});
			},
			fieldValues:
			{
				summary : 'Bug <WRITE DESCRIPTION OF BUG>',
				description : '1. URL of page: \n2. Description of problem:\n',
				priority : '2'
			}
		},
		// Request a Feature
		'5678' :
		{        
			"triggerFunction": function(showCollectorDialog)
			{
				jQuery("#trigger-5678").click(function(e) 
				{
					e.preventDefault();
					showCollectorDialog();
				});
			},
			fieldValues:
			{
				summary : 'Requesting <WRITE DESCRIPTION OF FEATURE>',
				description : ''
			}
		}
	});
});
</script>
<input type="button"  id="trigger-1234" class="button" value="Report a Bug" />
<input type="button"  id="trigger-5678" class="button" value="Request a Feature" />
Deleted user January 30, 2018

<html>
<head>

<script src="http://code.jquery.com/jquery-latest.js"></script>

<script type="text/javascript" src="http://jiraserver/s/d70a9476e833ed77aaf556244a3e4c68-T/w7wh6q/73015/0bdda96c6f554d3ad8620a330f9105c8/2.0.23/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=de-DE&collectorId=4cf95a36">4cf95a36</script>

<script type="text/javascript" src="http://jiraserver/s/d70a9476e833ed77aaf556244a3e4c68-T/w7wh6q/73015/0bdda96c6f554d3ad8620a330f9105c8/2.0.23/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=de-DE&collectorId=4cf95a36"></script>

<script type="text/javascript" src="http://jiraserver/s/d70a9476e833ed77aaf556244a3e4c68-T/w7wh6q/73015/0bdda96c6f554d3ad8620a330f9105c8/2.0.23/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=de-DE&collectorId=daaad45"></script>


<script type="text/javascript">
window.ATL_JQ_PAGE_PROPS = $.extend(window.ATL_JQ_PAGE_PROPS,
{
// Report a Bug
'<4cf95a36>':
{
triggerFunction: function(showCollectorDialog)
{
jQuery("#Bug").click(function(e)
{
e.preventDefault();
showCollectorDialog();
});
},

},
// Request a General Question
'<daaad45>':
{
triggerFunction: function(showCollectorDialog)
{
jQuery("#General").click(function(e)
{
e.preventDefault();
showCollectorDialog();
});
},
}
// Report a Bug
'4cf95a36':
{
triggerFunction: function(showCollectorDialog)
{
jQuery("#Improvement").click(function(e)
{
e.preventDefault();
showCollectorDialog();
});
},
},
});
</script>

</head>
<body>
<a href="#" id="Bug" class='btn btn-primary btn-large'>Report feedback</a>
<button style="background-color:DDDDDD" id="Bug">Report a Bug</button>
<button style="background-color:DDDDDD" id="General">General Questions</button>
<button style="background-color:DDDDDD" id="Improvement">Request for Installation</button>

</body>
</html>

 

So I tried to emulate your code. this ist what I came up to but its not working. like there is something missing. I think its not able to get the ID. Can you see where the problem is?

0 votes
GabrielleJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 1, 2016

Is this all of it? Where's the javascript part where it has your JIRA URL and the issue collector ID?

Daniel Deeds April 1, 2016

left the JIRA url off and changed the collector IDs to generic names (client's request) but verified to be correct on the site. The problem is either a bug in 6.0.5 or something messed up in my syntax that i'm not seeing smile

Suggest an answer

Log in or Sign up to answer