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

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

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!

ok - thanks, will try this out.

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

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

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>

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 Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

443 views 6 11
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