The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to set a user picker cf?

Louisa Pabst
August 6, 2015

Hi,

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 {it.name == 'Customer'}
issue.setCustomFieldValue(cf, valueCustomer)

 

Best regards,

Louisa

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 6, 2015

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

Louisa Pabst
August 6, 2015

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

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 6, 2015

Did you check the logs?

TAGS
AUG Leaders

Atlassian Community Events