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

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

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.

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.

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.

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;

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();

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

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

Also is there any equivalent class for "" for Jira 6.4.2 ? And also corresponding method for "findUsersByFullName" ?

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

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

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,933 views 12 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot