Uploaded image for project: 'Xporter for Jira'
  1. Xporter for Jira
  2. XPORTER-3761

NullPointerException generated in the log when the condition is false on post-function

    XporterXMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Done
    • 6.7.0
    • 6.7.2
    • Workflow Post Function
    • None
    • JIRAXPORTER 2021 Sprint 6
    • OK

    Description

      Description
      NullPointerException generated in the log when the condition is false on post-function

      Pre-conditions
      N/A

      How to reproduce

      1. Create an Xporter post-function with a Javascript condition,
      2. Add the following Javascript code to the condition:
        var labels = '${Labels}'
        var priority = '${Priority}'
        !(labels.indexOf('Man') >= 0) && !(priority.indexOf('Block') >= 0)
      3. Add a Label "Manual" and set the Priority to "Blocker" to an issue
      4. And transition the issue into a status that triggers the post-function

      Actual result/Attachments
      If the condition evaluates as "true", normal behavior happens.
      When the condition evaluates as "false", it generated NullPointerException in the logs:

      2021-04-30 00:38:16,689+0200 http-nio-8081-exec-55 url: /rest/api/2/issue/OSE-127992/transitions; user: portalose-only ERROR portalose-only 37x49292x3 gt4hy 194.181.0.102,0:0:0:0:0:0:0:1 /rest/api/2/issue/OSE-127992/transitions [c.x.jiraxporter.workflow.XporterPostFunctionAction] Error performing post function
      java.lang.NullPointerException
      	at com.xpandit.jiraxporter.manager.impl.XporterAuditServiceImpl.create(XporterAuditServiceImpl.java:79)
      	at com.xpandit.jiraxporter.manager.impl.XporterAnalyticsServiceImpl.publishEventXporterPostFunction(XporterAnalyticsServiceImpl.java:1071)
      	at com.xpandit.jiraxporter.workflow.XporterPostFunctionAction.execute(XporterPostFunctionAction.java:836)
      	at com.opensymphony.workflow.AbstractWorkflow.executeFunction(AbstractWorkflow.java:1014)
      

      Expected result
      No errors generated in the logs.

      Version

      • Xporter 6.7.0

      Attachments

        Activity

          People

            afro Andre Fernandes Rodrigues
            rmsp Rogerio Paiva [X] (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h