It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

script runner doesn't work for a specific user (administrator)

Olivier Albertini Feb 27, 2015

When I use a normal user, the script works fine but when I use oalbertini (administrator) the script doesn't work...

here the error when I use oalbertini :

2015-02-27 10:42:46,730 http-bio-8090-exec-13 ERROR oalbertini 642x5796x1 1xwhhou   /secure/CommentAssignIssue.jspa [scriptrunner.jira.workflow.ScriptWorkflowFunction] Script function failed on issue: ST-38045, actionId: 891, file: <inline script>
com.atlassian.jira.exception.CreateException: An unknown exception occured executing Validator com.atlassian.jira.workflow.SkippableValidator@2448ef3a: root cause: java.lang.NullPointerException
	at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(
	at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(
	at com.atlassian.jira.issue.IssueManager$ Source)
	at com.atlassian.jira.issue.IssueManager$ Source)
Caused by: com.atlassian.jira.workflow.WorkflowException: An unknown exception occured executing Validator com.atlassian.jira.workflow.SkippableValidator@2448ef3a: root cause: java.lang.NullPointerException
	at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(
	at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(
	... 4 more
Caused by: com.opensymphony.workflow.WorkflowException: An unknown exception occured executing Validator com.atlassian.jira.workflow.SkippableValidator@2448ef3a: root cause: java.lang.NullPointerException
	at com.opensymphony.workflow.AbstractWorkflow.verifyInputs(
	at com.opensymphony.workflow.AbstractWorkflow.initialize(
	at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(
	... 5 more
Caused by: java.lang.NullPointerException
	at com.atlassian.jira.workflow.validator.AbstractPermissionValidator.hasUserPermission(
	at com.atlassian.jira.workflow.validator.PermissionValidator.validate(
	at com.atlassian.jira.workflow.SkippableValidator.validate(
	at com.opensymphony.workflow.AbstractWorkflow.verifyInputs(
	... 8 more
2015-02-27 10:42:51,123 ISSUE-indexQueue:thread-1 INFO oalbertini 671x925x1 m1jov7    /secure/admin/jira/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 65% complete. Current index: Issue


Here my script :


import com.atlassian.jira.user.UserUtils
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.util.ImportUtils
import com.atlassian.crowd.embedded.api.User
import com.opensymphony.workflow.WorkflowContext
import org.apache.log4j.Category
import com.atlassian.jira.issue.fields.CustomField
log = Category.getInstance("com.onresolve.jira.groovy.CreateDependentIssue")
// Configurable section
def projectName = "Technician" // Name of project you want to create the issue in
def CustomTechFieldName = "customfield_11812"
def CustomLocationName = "customfield_10312"
def CustomTerminalName = "customfield_11811"
def customFieldManager = ComponentManager.getInstance().getCustomFieldManager()

CustomField customFieldTech = customFieldManager.getCustomFieldObject(CustomTechFieldName)
CustomField customFieldLocation = customFieldManager.getCustomFieldObject(CustomLocationName)
CustomField customFieldTerminal = customFieldManager.getCustomFieldObject(CustomTerminalName)

def customFieldTechVal = issue.getCustomFieldValue(customFieldTech).name
def customFieldLocationVal = issue.getCustomFieldValue(customFieldLocation)
def customFieldTerminalVal = issue.getCustomFieldValue(customFieldTerminal)

// for other customisations change the code below

issueMgr = ComponentManager.getInstance().getIssueManager()
projectMgr = ComponentManager.getInstance().getProjectManager()
String currentUser = ((WorkflowContext) transientVars.get("context")).getCaller();
User currentUserObj = UserUtils.getUser(currentUser);

def wasIndexing = ImportUtils.indexIssues
ImportUtils.indexIssues = true
issueFactory = ComponentManager.getInstance().getIssueFactory()
newissue = issueFactory.getIssue()
newissue.setSummary (issue.summary+"- "+customFieldTerminalVal)
newissue.setProject (projectMgr.getProjectByName(projectName))
newissue.setIssueType (issue.getIssueType())
newissue.description = issue.description
newissue.assignee = UserUtils.getUser(customFieldTechVal);
newissue.reporter = issue.getAssignee()
def cf = customFieldManager.getCustomFieldObjects(issue).find { == 'Location'}
newissue.setCustomFieldValue(cf, issue.getCustomFieldValue(cf))
params = ["issue":newissue]
subTask = issueMgr.createIssue(currentUserObj, params)
println subTask.get("key")
// get the current list of outwards depends on links to get the sequence number
linkMgr = ComponentManager.getInstance().getIssueLinkManager()
def sequence = 0
for (IssueLink link in linkMgr.getInwardLinks( {
    if ("Blocks" == {
linkMgr = ComponentManager.getInstance().getIssueLinkManager()
// TODO: Should check that 10000 is always the link id for Blocks
linkMgr.createIssueLink (,, 10000, sequence, currentUserObj)
ImportUtils.indexIssues = wasIndexing


With the user oalbertini, the script always fails. If I use a different user for the same issue and transition, the script works...

The same problem occurs on different scripts.

This script is executed on JSD project. When an agent change the status "Waiting for support" to "Waiting for Technician"

2 answers

0 votes
JamieA Feb 27, 2015

Does oalbertini have permissions to create an issue or whatever you're doing in the UI? JSD seems to be causing all kinds of weird problems.

0 votes
Olivier Albertini Feb 27, 2015

Yes I can do everything on all projects included this project. and I'm an agentscript runner.PNG

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Marketplace Apps & Integrations

Webinar alert! An IT Admin's Guide to Securing Collaboration at Scale

Hello, Atlassian Community! My name is Dave Meyer and I'm a Principal Product Manager at Atlassian. I wanted to give this community a heads up about an upcoming Webinar that might be of interest...

171 views 2 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you