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

Script Fragment Errors do not log information that users can use to find the broken fragment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • Low
    • Resolution: Done
    • 6.0.2
    • 6.5.0
    • Script Fragments
    • None
    • SR4J Sprint 81
    • 0.4

    Description

      Problem

      When a Script fragment breaks or has bad code the errors produced in the atlassian-jira.log do not contain enough information for the user or support to then be able to find the broken fragment.

      Currently, we only output content like this to the log:

      2020-06-25 15:27:15,873 http-nio-2995-exec-5 ERROR anonymous 927x98141x1 q9n6pr 192.168.1.112 /projects/SSPA/versions/10006 [c.o.scriptrunner.fragments.ScriptCondition] Script condition failed: 
      groovy.lang.MissingPropertyException: No such property: jiraHelperG for class: Inline662665272
      	at Inline662665272.run(Inline662665272.groovy:3)
      	at Inline662665272$run.call(Unknown Source)
      	at com.onresolve.scriptrunner.fragments.ScriptCondition.shouldDisplay(ScriptCondition.groovy:61)
       

      The above error occurs when the "Hide system or plugin UI element" fragment is used with an invalid variable. "jiraHelperG" is not a real variable and so the error is correct.

      If the user has 100's of fragments and a lot of them operate on the same location, the above error does not help them find the broken fragment.

      We need to provide an ID like the fragment ID from the saved configuration in the logs so we have some way to uniquely identify the failing fragment.

      Steps to reproduce:

      1. Make a "Hide system or plugin UI element" script fragment that hides anything. Use something obvious like the "com.atlassian.jira.jira-view-issue-plugin:peoplemodule" to hide the People section on the issue view page
      2. Use a condition like:
        jiraHelperG.project?.key in ["JRA"]
        
      3. Go to the issue view page and then check the logs. You should then see the above error

       

       

       

       

      Attachments

        Activity

          People

            krana Kyran Rana [X] (Inactive)
            mclark Matthew Clark
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: