Issue collector - does someone has an example how to use the custom trigger ?

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 2, 2012

The issue collector allows to use a custom trigger. How do you actually setup the page such that if the user clicks on a link, the dialog box pops up ?

4 answers

1 accepted

6 votes
Answer accepted
StaceyA July 17, 2012

It was a bit confusing for me too. When creating a new issue collector and you select custom trigger, you see this snippet of code:

function(onclickHandler) {
  //Requries that jQuery is available! 
  jQuery("#myCustomTrigger").click(function(e) {
    e.preventDefault();
    onclickHandler();
  });
}

In this case, you just need to change the name of "myCustomTrigger" to the id of what you want to use it with. For example, I chose this:

<a id="feedback-link">Feedback</a>

So I changed that code snippet to be this:

function(onclickHandler) {
  //Requries that jQuery is available! 
  jQuery("#feedback-link").click(function(e) {
    e.preventDefault();
    onclickHandler();
  });
}

When you create the new collector, this snippet of code gets put INTO the script that you attach with html to the bottom of the page. All you need to do now is have your element on the screen and have the html snippet at the bottom of the page and you do NOT need to insert that javascript anywhere.

Hope this helps!

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 19, 2012

ok - thanks, will try this out.

0 votes
Stephen Pavlik November 18, 2015

When I try to customize the link for the issue collector the default JIRA link always appears in the rendered page and what ever link I try to use does not invoke the collector window to appear. However, the JIRA default link always works.

 

My code:

<!DOCTYPE html>
<html>
<head>


<script type="text/javascript"  src="jquery_v1_x.js"></script>



<script type="text/javascript" src="https://our_domain/s/132db92a7c4910b1b669ccc6291c9efa-T/en_US-p5m6n0/64025/11/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=d4401b08"></script>



<script type="text/javascript">
function(onclickHandler) {
  jQuery(".button").click(function(e) {
    e.preventDefault();
    onclickHandler();
  });
</script>


</head>
<body>

<input type="button" style="color:green" id="myCustomTrigger" class="button" value="test" />

</body>
</html>

0 votes
raj k October 28, 2012

HI All,

Am using JIRA Issue collector in my .net web application. I have a specific requirement. I want to keep one issue collector for a set of pages and a diff issue collector for another set. One solution is embed separate scripts into each set. But its tedious as I have huge number of pages,

Can someone help me with a feasible solution..?

Any help would be greatly appreciate..

Regards

Raj

0 votes
Stacey Today July 14, 2012

+1 for an example of adding a custom trigger to a html page.

Suggest an answer

Log in or Sign up to answer