Details
-
Bug
-
Status: Done
-
High
-
Resolution: Fixed
-
5.3.1, 5.3.2
-
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:
- Rename a user (Administration -> Edit user)
- Attempt to create a post-function and run the script as that user
- 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.