Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-3942

Script Fragments that use Script files instead of inline scripts do not detect changes to script files

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Triage
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: 5.6.2.1-jira8
    • Fix Version/s: None
    • Component/s: Fragments
    • Labels:
      None
    • Critical Points:
      1.4

      Description

      If you create a script fragment that adds, for example, a new menu item to the board context menu and you use a script file stored in the script roots instead of an inline script, when you make changes to the script file, the changes are not detected until the user edits the web item within the User interface and saves it again.

      Steps to reproduce:

      1. Create a "Planning board context menu item" script fragment
      2. Put it in this section "Issues in active sprints"
      3. Create a script in your script roots like this:
        import com.atlassian.jira.issue.Issue
        import org.apache.log4j.Logger
        import org.apache.log4j.Level
        
        def log = Logger.getLogger(getClass())
        log.setLevel(Level.DEBUG)
        
        log.debug("-----------------------")
        log.debug(issues.size())
        log.debug("-----------------------")
        
        issues.size() >= 2
      1. Add that file as the "Condition" for the web-fragment
      2. Set "Do what" to "Navigate to a link" and just add google.com as the link
      3. Add the fragment and go to a SCRUM board > Backlog > multi-select 2 issues and you should see the new menu item when you right-click to see the context menu.
      4. Select just 1 issue and right click and you should NOT see the new menu item
      5. Now change the script file to "issues.size() >= 4" so it should now only show if you multi-select 4 or more issues
      6. Go back to the board and refresh the page then multi-select 2 items again and you will still see the menu item even though it should not show.
      7. Go to the fragment within the User interface and edit it, then click update. This will then correctly apply the changes made to the file

      Expectation

      The changes to the script file should be picked up automatically

       

      Note: Hard refresh does NOT fix it

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mclark Matthew Clark
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: