Uploaded image for project: 'SR Platform'
  1. SR Platform
  2. SRPLAT-930

Nested script execution breaks log capture

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Critical Points:
      0.7

      Description

      Nested script execution overrides "sr.execution.id" in Log4j MDC storage and as the result scripts running up the stack lose remaining log entries.

      To reproduce configure Script Listener that listens to Issue Created event and run the following script in the console:

      import com.atlassian.jira.component.ComponentAccessor
      
      log.level = org.apache.log4j.Level.DEBUG
      
      def i = ComponentAccessor.issueFactory.issue
      i.summary = "Smm"
      i.projectObject = ComponentAccessor.projectManager.getProjectByCurrentKey("MTS")
      i.issueTypeId = "10006"
      i.reporterId = "admin"
      i.description = "Desc"
      
      log.debug "First"
      ComponentAccessor.issueManager.createIssueObject(
          ComponentAccessor.jiraAuthenticationContext.loggedInUser,
          i
      )
      log.debug "Second"
      

      Logs shown in browser will contain only the first log entry

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              szaporozhtsev Sergey Zaporozhtsev [X] (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: