Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Launching an issue collector automatically

Timur Rozenfeld February 18, 2013

This code launches an issue collector automatically perfectly in FireFox, but doesn't work at all in IE 8 or 9.

Do you have any suggestions on making this work so the issue collector is launched automatically?

Thanks.

window.ATL_JQ_PAGE_PROPS = $.extend(window.ATL_JQ_PAGE_PROPS, {
            triggerFunction: 
            function (showCollectorDialog) {
                //Requries that jQuery is available!
                $(this).on('load', function (e) {
                e.preventDefault();
                showCollectorDialog();
                });
            }
        });

6 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Ryan Clark January 20, 2015

This is what I ended up doing.. I didn't like doing it with setTimeout but it ended up working the best for me across browsers. In my testing the average time before the dialog was available was 13ms, so 100ms is overkill.

window.ATL_JQ_PAGE_PROPS =  {
    "triggerFunction": function(showCollectorDialog) {
        setTimeout(function() {
            if(showCollectorDialog !== undefined)
                showCollectorDialog();
        }, 100);
    }
};
Kim Andersson May 20, 2016

Works for Chrome

Works for IE with ActiveX controls active

 

Sunny Tambi November 2, 2016

I did almost the same setTimeout.. but on page load.

 

window.ATL_JQ_PAGE_PROPS =  {
			"triggerFunction": function(showCollectorDialog) {
				/*Requires that jQuery is available! */
				jQuery(document).ready(function(){
					/*e.preventDefault();*/
					setTimeout(function(){
						console.log("opening");
						showCollectorDialog();
					}, 50);
					
				});
			}
Like Aimee Swift likes this
0 votes
NathanG
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.
August 14, 2015

Here is the code that we are using on it's own html page:

<html>
<head>
    <script type="text/javascript" src="http://jira/s/54b21e2fd34cf99d3ff4dbf12b529b17-T/en_US943ngd/64021/29/1.4.25/_/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=68d7360c"></script>
    <script type="text/javascript">
    
        function getInternetExplorerVersion()
        // Returns the version of Internet Explorer or a -1
        // (indicating the use of another browser).
        {
          var rv = -1; // Return value assumes failure.
          if (navigator.appName == 'Microsoft Internet Explorer')
          {
            var ua = navigator.userAgent;
            var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
            if (re.exec(ua) != null)
              rv = parseFloat( RegExp.$1 );
          }
          return rv;
        }//end function
          
        var ver = getInternetExplorerVersion();
        if ( ver > -1 ) {
            //using IE
            window.ATL_JQ_PAGE_PROPS =  {
                "triggerFunction": function(showCollectorDialog) {
                    //Requires that jQuery is available! 
                    jQuery("#myCustomTrigger").click(function(e) {
                        e.preventDefault();
                        showCollectorDialog();
                    });
                }};
        } else {
            //using Chrome or Firefox
            window.ATL_JQ_PAGE_PROPS =  {
                "triggerFunction": function(showCollectorDialog) {
                    setTimeout(function() {
                        if(showCollectorDialog !== undefined)
                            showCollectorDialog();
                    }, 100);
                    jQuery("#myCustomTrigger").click(function(e) {
                        e.preventDefault();
                        showCollectorDialog();
                    });
                }
            };
        }// if / else
    </script>
</head>
 
<body>
<h2 style="text-align: center; margin-top: 200px;">System Request Form</h2>
<p style="text-align: center;"><a href="#" id="myCustomTrigger">Click here to load the form if it doesn't load automatically</a>
<p style="text-align: center;">After filling out the request form, you can close this window.</p>
 
</body>
</html>
0 votes
Jure Simon April 8, 2015

you could also call

$(window).load(function(){            
            $(".atlwdg-trigger").click();
        })

in footer

0 votes
Benjamin Mueller March 6, 2014

I'm interested to know as well.

Onkar Ahire
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.
September 30, 2014

me too !

0 votes
Raju KC
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 30, 2013

Any solutions??????????

0 votes
Daniel February 18, 2013

I'm interested to know as well.

We load the issue collector's javascript file just in time as the user goes to the support menu, to avoid unneeded overhead at every page load.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events