Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-60715

issue collector script wont run as embedded javascript in "strict" mode

    XMLWordPrintable

Details

    • Severity 3 - Minor
    • Hide
      Atlassian Update – 22 August 2019

      Hi everyone,

      After reviewing the overall customer interest and impact of this bug report we have decided to close this issue down. Our analysis has shown that over time this issue hasn't collected a significant number of votes, watchers, comments, or support cases from customers and therefore has remained very low on our priority list. Given these findings we can conclude it will not be fixed in the foreseeable future and wish to be transparent about our priorities by closing it as Timed Out.

      Although we're aware this issue may be still important to those of you who were involved in the initial conversations around it, we want to be clear by managing your expectations regarding the likelihood of a fix for it. The Jira team do their best to prioritise the issues that have high and critical impact with broad pervasiveness reflected in series of different factors. You can learn more about this by reading our Bug Fixing Policy.

      To see what the Jira team is currently working on and has recently delivered see the following dashboards:

      We understand that hearing a decision like this can be disappointing, but we hope you'll appreciate our transparent approach to product priorities and communications. We will continue to watch this issue for further updates, so please feel free to share any thoughts in the comments.

      Thank you,

      Pawel Drygas,

      Jira Server Bugmaster

      Show
      Atlassian Update – 22 August 2019 Hi everyone, After reviewing the overall customer interest and impact of this bug report we have decided to close this issue down. Our analysis has shown that over time this issue hasn't collected a significant number of votes, watchers, comments, or support cases from customers and therefore has remained very low on our priority list. Given these findings we can conclude it will not be fixed in the foreseeable future and wish to be transparent about our priorities by closing it as Timed Out . Although we're aware this issue may be still important to those of you who were involved in the initial conversations around it, we want to be clear by managing your expectations regarding the likelihood of a fix for it. The Jira team do their best to prioritise the issues that have high and critical impact with broad pervasiveness reflected in series of different factors. You can learn more about this by reading our Bug Fixing Policy . To see what the Jira team is currently working on and has recently delivered see the following dashboards: Jira Server and Data Center: Recently resolved issues Jira Server and Data Center: Current work and future plans Jira Server and Data Center: Bug Fix Board We understand that hearing a decision like this can be disappointing, but we hope you'll appreciate our transparent approach to product priorities and communications. We will continue to watch this issue for further updates, so please feel free to share any thoughts in the comments. Thank you, Pawel Drygas, Jira Server Bugmaster

    Description

      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.

      I was trying to use the issue collector with a custom trigger as embedded javascript (not html).
      However it failed to Pop Up the bug reporter dialogue form.

      It did work as HTML added to my page.

      On investigation I found out that the script downloaded was not in "strict" mode. Because the javascript file I was embedding it in was in strict mode it failed. (my build system uses webpack to bundle all my js). The problem was the the script downloaded to my page referenced a variable called "hideDialog" and this variable is not prefixed by the "var" keyword which failed strict mode.

      I fixed it locally by manually downloading the javascript referred to in the embeddable snippet ie
      https://avocadoconsulting.atlassian.net/s/e8998266a22de47600f7a8650aafb214-T/hdpdpv/72002/b6b48b2829824b869586ac216d119363/2.0.13/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs.js?locale=en-UK&collectorId=f4742d98

      I added the "var" keyword in front of the "hideDialog" variable at that URL where it is defining a function, it at the declaration of "hideDialog" not at its usages.

      I then modified the "url" reference in the JQuery ajax call given in the embeddable JavaScript (see below) to call my file rather than your URL... it then worked fine

      I assume that the fix for you is to place "use strict;" in your source file and put "var" in front of "hideDialog" in its declaration.

      Cheers

      Karl Roberts
      karl.roberts@owtelse.com
      karl.roberts@avocadoconsulting.com.au

      FYI the embedded javascript code I received from Jira's issue collector page is below.

      // Requires jQuery!
      jQuery.ajax(

      { url: "https://avocadoconsulting.atlassian.net/s/e8998266a22de47600f7a8650aafb214-T/hdpdpv/72002/b6b48b2829824b869586ac216d119363/2.0.13/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs.js?locale=en-UK&collectorId=f4742d98", type: "get", cache: true, dataType: "script" }

      );

      window.ATL_JQ_PAGE_PROPS = {
      "triggerFunction": function(showCollectorDialog) {
      //Requires that jQuery is available!
      jQuery("#myCustomTrigger").click(function(e)

      { e.preventDefault(); showCollectorDialog(); }

      );
      }};

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              6cd2822cd670 Karl Roberts
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0.5h
                  0.5h
                  Remaining:
                  Remaining Estimate - 0.5h
                  0.5h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified