How to set a user picker cf?


i want to set the user picker field "customer" in a subtask. The subtask was created in a transition of the parentissue. The value of the user picker "customer" is set in the maintask during the same transition and I want to copy this value to the cf in  the subtask. I've tried the following code:

def trans = transientVars["issue"]
def valueCustomer = trans.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("customer"))
def cf = customFieldManager.getCustomFieldObjects(issue).find { == 'Customer'}
issue.setCustomFieldValue(cf, valueCustomer)


Best regards,


1 answer

First of all you're getting "customer", then later "Customer". It should be throwing an NPE with your code, check the logs.

Thanks for your fast response! I'm sorry that was a stupid mistake! however, it still does not work :/

Did you check the logs?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,115 views 4 9
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you