Uploaded image for project: 'SR for Confluence - Development'
  1. SR for Confluence - Development
  2. SRCONF-127

Submitting an event handler with no events causes all event listeners to fail to display

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 4.3.1
    • Fix Version/s: 4.3.7
    • Component/s: None
    • Labels:
    • Sprint:
      Sprint 26 - Ends Aug 16, Sprint 26 - Ends Sept 1, Sprint 26 - Ends Oct 3
    • Critical Points:
      1

      Description

      If you submit a new Event Listener without specifying an event, instead of displaying a validation error, confluence will throw a null pointer exception behind the scenes.

      After that, no event listeners will be visible in the list (even previously created valid event listeners), and it will be impossible to add new visible ones.

      The stack trace thrown is in the attached log. The com.onresolve.scriptrunner.runner.rest.confluence.ListenersRestEndpoint class is responsible for this.

      Workaround

      To fix this, you can find and delete any events listeners that don't have a list of events defined. Running the following in the script console should take care of that.

      import com.onresolve.scriptrunner.confluence.ConfluenceEventListener
      import com.onresolve.scriptrunner.runner.util.AOPropertyPersister
      def handlers = AOPropertyPersister.loadList(ConfluenceEventListener.AO_PROPERTY_KEY)
      handlers.removeAll {
          ! it["events"]
      }
      AOPropertyPersister.save(handlers, ConfluenceEventListener.AO_PROPERTY_KEY)
      

        Attachments

          Activity

            People

            Assignee:
            jcarter Jonny Carter
            Reporter:
            jcarter Jonny Carter
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

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