Is it possible to copy Full name instead of username to 'Assignee' field in Jira?

Rupa Jain January 12, 2018

We have a CRM database that stores Full Names. We are required to assign tickets based on these values in CRM.

Hence we have a nFeed field that extracts values from database, and this value is then copied to the 'Assignee' field.

But this does not work as we are trying to copy Full Name to 'Assignee' field.

Any ideas/suggestions to make this work?

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2018

No.  The assignee field is effectively a list of user objects.  You need to give it the right user object for it to work.  Your nFeed field needs to work from user login ids, not name.

Rupa Jain January 12, 2018

Our organisation uses numerical usernames like z12345 which are not at all user-friendly and hence we are using full names instead.

Will it be possible to copy full name to any other user field if not 'Assignee'? We can then copy it to Assignee.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 13, 2018

No.  A user field contains a user object, the same way an assignee does.

It's utter nonsense to use something like the user's given name in a user field.  It has to be something that uniquely identifies them.  In many cases a given name can do that, but it allows for failures, and hence cannot be used. 

For example, imagine a Jira system that my family uses.  "Nic" is unique in the family.  But when my father-in-law Jim uses it, how does the computer know it is him and not his brother in law, Jim, or his cousin, Jim?  Even adding a surname won't solve it - they're Jim Barclay, Jim Dart and Jim Barclay

For a user field to work, it must be able to uniquely identify a user.  A full name fails that test.

The best you will be able to do is a text field that asks for a name and then tries to work out who it might be in your list of users, so it can populate assignee with the unique id it requires.  But you're going to have to do a lot of thinking and coding around how to deal with duplicate names, misspellings and non-matching entries.

Rupa Jain January 19, 2018

I am trying to use this script but getting errors:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.bc.user.search.UserPickerSearchService;


CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();

def nFeedField = issue.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_12345"));

def userPickerSearchService = ComponentAccessor.getComponent(UserPickerSearchService);
def assignee = userPickerSearchService.findUsers("nFeedField[0]);
issue.setAssignee(assignee);
issue.store();

Rupa Jain January 19, 2018

Also is there any equivalent class for "com.atlassian.jira.bc.user.search.UserSearchService" for Jira 6.4.2 ? And also corresponding method for "findUsersByFullName" ?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 19, 2018

Your "def assignee" line is totally wrong, have another look at it.

Rupa Jain January 19, 2018

Will the findUsers() method not retirn username if full name is passed to it?

Suggest an answer

Log in or Sign up to answer