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

Running post-functions as a renamed user throws exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • High
    • Resolution: Fixed
    • 5.3.1, 5.3.2
    • 5.3.13
    • Workflow Functions
    • None
    • JIRA 7.7.0

    • Sprint 37 - Ends Jan 29
    • 0

    Description

      Some post-functions, like "Closes an issue, and links", allow you to specify a user to run the script with: 

      Strangely, if you change a user's username, attempting to run a script as that re-named user will cause the script to fail.

      2018-02-08 11:00:06,292 http-bio-8080-exec-7 ERROR newAdmin [scriptrunner.jira.workflow.ScriptWorkflowFunction] Script function failed on issue: JRA-1, actionId: 4, file: null
      com.onresolve.scriptrunner.canned.util.InboundTransformationException
      at com.onresolve.scriptrunner.canned.common.params.UserParamProvider.getUserKeyFromName(UserParamProvider.groovy:101)
      at com.onresolve.scriptrunner.canned.common.params.UserParamProvider$_getUserKeyParam_closure1.doCall(UserParamProvider.groovy:51)
      at com.onresolve.scriptrunner.canned.common.params.ParameterUtils.performSingleInboundTransformation(ParameterUtils.groovy:55)
      at com.onresolve.scriptrunner.canned.common.params.ParameterUtils$_performInboundTransformation_closure2.doCall(ParameterUtils.groovy:44)
      at com.onresolve.scriptrunner.canned.common.params.ParameterUtils.performInboundTransformation(ParameterUtils.groovy:41)
      at com.onresolve.scriptrunner.canned.common.params.ParameterUtils$performInboundTransformation.callStatic(Unknown Source)
      at com.onresolve.scriptrunner.jira.workflow.ScriptWorkflowFunction.executeInboundTransformation(ScriptWorkflowFunction.groovy:251)
      at com.onresolve.scriptrunner.jira.workflow.ScriptWorkflowFunction$executeInboundTransformation$3.callCurrent(Unknown Source)
      at com.onresolve.scriptrunner.jira.workflow.ScriptWorkflowFunction.run(ScriptWorkflowFunction.groovy:164)
      at com.onresolve.scriptrunner.jira.workflow.ScriptWorkflowFunction$run$0.callCurrent(Unknown Source)
      at com.onresolve.scriptrunner.jira.workflow.ScriptWorkflowFunction.execute(ScriptWorkflowFunction.groovy:93)
      

      It will also cause the post function to become un-editable and it's description broken.

      Steps to Reproduce:

      1. Rename a user (Administration -> Edit user)
      2. Attempt to create a post-function and run the script as that user
      3. Exception is thrown and script fails

      Reindexing, restarting JIRA, etc. do not fix the issue. Using the UserManager in the script console to get the renamed user appear to give the correct results.

      This applies to newly created post-functions and existing post-functions.

      Attachments

        Activity

          People

            tbatagiannis Thanos Batagiannis
            jyamdogo Josh Yamdogo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: