Can I restrict assignee selection to members of a group picker custom field?


I am trying to create a notification scheme that will send a notification to one of five "tech approver" groups created in JIRA, when the ticket reaches a certain part of the workflow (ie "awaiting tech approval").

I have created a post-function on the transition to the "awaiting tech approval" stage. The post-function fires an event, which in turn notifies the group specified in a custom field group picker in the ticket.

The problem is that when entering the group in the field, you can see ALL of JIRA's groups. Which is a lot more than five.

Is there a way of limiting the number of groups?

Alternatively, I would like to create a dropdown custom field picker, where the user selects an "area" that is mapped to the appropriate group. (ie picking "Enterprise" in the field would then result in a post-function mapping Enterprise to "tech-notify-enterprise"). Is there any way of doing this?

Thanks for your time.

2 answers

1 accepted

3 votes
Accepted answer

==== UPDATE FROM Oct 29th, 2018 ====

Please scroll in comments for an updated answer and an alternative method.


Hi Adam,

My suggestion would be to edit your permission scheme and grant the "Assignable User" permission to a group custom field value as described below:cfAssignee.png

That would only allow users from the group in the custom field to be assignee. Please note that this will apply to the whole project and you'll need to carefully prefill this custom field with the relevant group at all time! The custom field value could be easily changed from a status to another using post functions.

Would that work?


Thanks very much Mickey. I don't think that would work for us because we still require the ticket to be assigned to someone else, we're just looking to notify one of a few groups. However, that is a really interesting feature and one I might use in future!

Best wishes and Merry Christmas


Micky CARITTE Community Champion Jan 04, 2018

Hi Adam,

Thanks for your feedback and sorry for my delayed response!

You have a happy new year and best luck with Jira :)

Thanks you too Micky.

In the end this was the solution I devised with the help of a colleague and the community. 

  1. I have the group picker, which is a single group custom field, which cannot be edited (by omitting it from the create/edit screen). I call this field "Technical Approvers Groups"
  2. I have a second custom field, which is a single choice, drop-down select list. This is a mandatory field on the create/edit screen. I call this "Change Area".
  3. I have a custom scripted field that is made using Scriptrunner. I use this to map the value from the select list in step 2, to the group picker in step 1. This custom field is hidden from view and works in the background. It is only applied to the project for which I'm using it. It uses the following script.
    import com.atlassian.jira.component.ComponentAccessor;
    import com.atlassian.jira.issue.CustomFieldManager;
    import com.atlassian.jira.issue.Issue;
    import com.atlassian.jira.issue.fields.CustomField;
    import com.atlassian.jira.issue.MutableIssue;
    import com.atlassian.jira.issue.ModifiedValue;
    import com.atlassian.jira.issue.util.DefaultIssueChangeHolder;

    MutableIssue issueToUpdate = (MutableIssue) issue;

    // create the map of Change Area names to approval groups
    def approvalGroupMap = [
    "TA Group 1" : "tech-approval-group1",
    "TA Group 2" : "tech-approval-group2",
    "TA Group 3" : "tech-approval-group3",
    "TA Group 4" : "tech-approval-group4",
    "TA Group 5" : "tech-approval-group5"

    // get the value of the "Change Area" field
    def changeAreaFieldObject = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_XXXXX");
    def changeArea = issue.getCustomFieldValue(changeAreaFieldObject).toString();

    //configure and define the value taken from the "Change Area" field as a group, rather than a simple string (this is necessary)
    def customFieldManager = ComponentAccessor.getCustomFieldManager()
    def groupManager = ComponentAccessor.getGroupManager()
    def group = groupManager.getGroup(approvalGroupMap[changeArea])

    //taking the group value defined immediately above, use it to set Techical Approvers Group field
    def tgtField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjects(issue).find { == "Technical Approvers Groups"}
    def changeHolder = new DefaultIssueChangeHolder();
    def mv = new ModifiedValue(issue.getCustomFieldValue(tgtField), [group]);
    tgtField.updateValue(null, issue, mv,changeHolder);

    //test with a return group to make sure it is working.
    return group

    What all this allows me to do is have a user-friendly and limited choice custom field, with option names I can control and which are mapped on the back end to specific JIRA groups.

  4. I have a custom notification, which alerts the group mapped in the custom field Technical Approvers Groups. 
  5. Finally I set up a post-action on a transition (called Submit for Review) that fires the notification out to the appropriate approver group.

Hope this helps anyone thinking about doing something similar!

Best wishes


Like 1 person likes this
Micky CARITTE Community Champion Jan 05, 2018

Great, interesting! Thanks for sharing!

Hi @Adam Gaudry, how did you managed to populate the Assignee field based on users on its group?

Hi Alvin

Sorry for the delayed response. I didn't populate the assignee field; what my solution does is populate a group field based on a single choice, drop-down select list.

It's a bit like this:

Custom field A = single choice, drop-down select list. There are 5 different options in this field, so you can select either option 1, 2, 3, 4, or 5.

Custom field B = single group field. 

Custom field C = this is a scripted field configured using Scriptrunner, that essentially takes the value of the choice in Custom field A and turns it to string, so it can be mapped to groups for Custom field B. 

Then in practice, when sometime makes a choice in Custom Field A, the scriptrunner field maps it to a group (according to its script, see above for more info), and the group gets selected in Custom field B.

Once that has run, I have set up the notification scheme so that the group defined in Custom field B is notified when a ticket is submitted for review.

Hope that makes sense.

Hi @Adam Gaudry , do you have sample code to work with? Thank you

Hi Alvin, the code I'm using is pasted above.

Like 1 person likes this

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,195 views 5 10
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