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

Failures in ScriptRunner validators when screen references custom field which is no longer installed

    Details

    • Type: Bug
    • Status: Done
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 6.21.0
    • Fix Version/s: 6.22.0
    • Component/s: None
    • Labels:
    • Sprint:
      SR4J Sprint 94
    • Critical Points:
      5.2

      Description

      Problem

      When a custom field provided by an app has been configured on a tab within a screen, if the app is uninstalled/disabled Jira APIs still return references to the custom field ID within the tab. 

      The invalid custom field ID is used to lookup the custom field, which fails and causes an exception to be thrown when retrieving the field name.

      Steps to reproduce

      • Add a ScriptRunner scripted validator to a workflow transition with a screen.
      • Install a third party custom field app (e.g Watcher custom field).
      • Add a custom field provided by the app to the tab configuration for the screen configured for the transition from the above step.
      • Disable the app providing the custom field.
      • Try and execute the workflow transition.

      Issues may arise in other areas e.g attempting to configure Field(s) changed validator

      java.lang.NullPointerException: Cannot invoke method getName() on null object
      	at com.atlassian.jira.issue.fields.Field$getName$1.call(Unknown Source)
      	at com.onresolve.scriptrunner.canned.jira.utils.ParameterValuesProvider$_getFieldsForTransition_closure5$_closure8.doCall(ParameterValuesProvider.groovy:102)
      	at com.onresolve.scriptrunner.canned.jira.utils.ParameterValuesProvider$_getFieldsForTransition_closure5.doCall(ParameterValuesProvider.groovy:101)
      	at com.onresolve.scriptrunner.canned.jira.utils.ParameterValuesProvider.getFieldsForTransition(ParameterValuesProvider.groovy:100)
      	at com.onresolve.scriptrunner.canned.jira.utils.ParameterValuesProvider.getFieldsForTransition(ParameterValuesProvider.groovy)
      	at com.onresolve.scriptrunner.canned.jira.utils.ParameterValuesProvider$getFieldsForTransition$0.call(Unknown Source)
      	at com.onresolve.scriptrunner.canned.jira.utils.FieldScreenVisibilityChecker.getVisibility(FieldScreenVisibilityChecker.groovy:34)
      	at com.onresolve.scriptrunner.canned.jira.utils.FieldScreenVisibilityChecker$getVisibility.call(Unknown Source)
      	at com.onresolve.scriptrunner.canned.jira.workflow.validators.SimpleScriptedValidator.execute(SimpleScriptedValidator.groovy:112)
      

       

       

       

        Attachments

          Activity

            People

            Assignee:
            jechlin Jamie Echlin
            Reporter:
            rlander Reece Lander
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: