Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Set Assignee from Custom Field

Hello everybody i would like to set the Assignee from a user picker custom field see code Below but nothing hapens

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.user.util.UserManager
def cField=ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_10401")
def cFValue = issue.getCustomFieldValue(cField) as ApplicationUser


2 answers

1 accepted

0 votes
Answer accepted

Hello @Heiko Treuner 

Where do you do it? In post functions, in listeners, in the console?

If it's a post-function it should be upper then 'Update change history for an issue and store the issue in the database.' function. In other cases, you should use issue update methods. For example

def issueInputParameters = issueService.newIssueInputParameters()

def updateValidationResult = issueService.validateUpdate(user, issue.getId(), issueInputParameters)

if (updateValidationResult.isValid()) {
issueService.update(user, updateValidationResult)

Hey thaks for ur answer i used it in the create post function and have it before 'Re-index an issue to keep indexes in sync with the database. ' but nothing happens

Try to move your function to the first place just before 'Creates the issue originally.' function

ok if found the reason by myself i have to do this below:

Like Alexander Bondarev likes this

Hi all,

how can we set the multiple assignee's in jira


def cField=ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_10401")

With this snippet you get a specific field where you can do what you want e.q. set other fields like the asignee field. If th fetched value a user picker field

Like RichardA likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

378 views 1 6
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