multiple issue collectors not working

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

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

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

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" />

<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?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Trello

Alice Camilla on organizing your work/life/fandoms with Trello!

@Alice Camilla is a university student, currently writing her MA thesis in Archaeology. She's also a freelance blogger and content creator, writing about geeky stuff from productivity apps to JR...

41 views 1 6
Read article

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