Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner workflow postfunction not updating after editing

Michael Scholz November 25, 2019

 

Hello,

I wanted to edit a postfunction (Script Post-Function [ScriptRunner] Function) in a workflow. After editing and publishing the changes the potfunction failed with following errors:

Time (on server): Thu Nov 21 2019 15:09:34 GMT+0100 (Mitteleuropäische Normalzeit)

The following log information was produced by this execution. Use statements like:log.info("...") to record logging information.

2019-11-21 15:09:34,816 ERROR [workflow.AbstractScriptWorkflowFunction]: *************************************************************************************
2019-11-21 15:09:34,817 ERROR [workflow.AbstractScriptWorkflowFunction]: Script function failed on issue: RECHTE-97629, actionId: 221, file: null
java.lang.NullPointerException
at com.atlassian.jira.scheme.AbstractSchemeManager.getSchemeFor(AbstractSchemeManager.java:201)
at com.atlassian.jira.scheme.SchemeManager$getSchemeFor.call(Unknown Source)
at com.atlassian.jira.scheme.SchemeManager$getSchemeFor.call(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.utils.AbstractCloneIssue$_copySystemFieldValues_closure9.doCall(AbstractCloneIssue.groovy:466)
at com.onresolve.scriptrunner.canned.jira.utils.AbstractCloneIssue.copySystemFieldValues(AbstractCloneIssue.groovy:433)
at com.onresolve.scriptrunner.canned.jira.utils.AbstractCloneIssue.execute(AbstractCloneIssue.groovy:181)
at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.CreateSubTask.super$4$execute(CreateSubTask.groovy)
at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.CreateSubTask.execute(CreateSubTask.groovy:141)
at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.CreateSubTask$execute.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.workflow.conditions.SimpleScriptedCondition$execute.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.workflow.AbstractWorkflowCannedScript.execute(AbstractWorkflowCannedScript.groovy:17)
at com.onresolve.scriptrunner.canned.jira.workflow.AbstractWorkflowCannedScript$execute.call(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.workflow.AbstractWorkflowCannedScript$execute.call(Unknown Source)
at com.onresolve.scriptrunner.jira.workflow.AbstractScriptWorkflowFunction$_run_closure1.doCall(AbstractScriptWorkflowFunction.groovy:93)
at com.onresolve.scriptrunner.jira.workflow.AbstractScriptWorkflowFunction$_run_closure1.doCall(AbstractScriptWorkflowFunction.groovy)
at com.onresolve.scriptrunner.runner.diag.DiagnosticsManagerImpl$DiagnosticsExecutionHandlerImpl.execute(DiagnosticsManagerImpl.groovy:325)
at com.onresolve.scriptrunner.runner.diag.DiagnosticsExecutionHandler$execute$3.call(Unknown Source)
at com.onresolve.scriptrunner.jira.workflow.AbstractScriptWorkflowFunction.run(AbstractScriptWorkflowFunction.groovy:86)

As a workaround I have to delete the postfunction and create it new.

greetings,

Michael

 

1 answer

0 votes
Solomon David Cherian November 25, 2019

Hello Michael,

Are you using a custom groovy script? If so can you provide the script?

Regards,

Solomon

Michael Scholz November 25, 2019

Hello Solomon,

no, I use the "Script post function" "create subtask" with a condition: 'Berlin' in cfValues['Standort angeben']*.value

Whereas the field "Standort angeben" is a multi select field.

Additional issue actions is a custom groovy script:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.label.LabelManager
def userManager = ComponentAccessor.getUserManager();

issue.summary = 'Zutrittskarte für ' + sourceIssue.summary;
issue.description = 'Hallo, \n bitte die Zutrittskarte für den/die User bereitstellen. \n \n Viele Grüße \n Service Desk.';
issue.assignee = userManager.getUserByName("zzzjirazutrittber");
issue.setSecurityLevelId(transientVars.get("issue").securityLevelId)
doAfterCreate = {
def labelManager = ComponentAccessor.getComponent(LabelManager)
def labels = ''
labelManager.setLabels(ComponentAccessor.jiraAuthenticationContext.getLoggedInUser(),issue.getId(),labels.toSet(),false,false)
}

 

I hope this helps. If you need more information feel free to ask.

Greetings,

Michael

Suggest an answer

Log in or Sign up to answer