How to set Custom Field value without Issue object using Groovy


I have a group picker in Create screen with some logic(Behaviours Groovy script) to filter the values in it and I have to add those filtered values to group picker. This may work using post function (as mentioned in because an Issue object will be created and available by this time.

"issue.setCustomFieldValue(singleGroupCf, [group])"

But in my case, I have this group picker in Create screen and hence, Issue object will not be created yet.


Can someone help me in adding the filtered values to group picker without Issue object using Groovy?

Appreciate your help!

1 answer

You can use your code as a post-function in the 'Create' transition. You just have to be aware, that your code will be executed after the first step "1. Create the issue".

Create a new custom script function in the post-function section of the workflow transition and then click on the little arrow on the right side to put the code one step later.


Thanks for your reply Thomas.


As you said I can put my code as post-function, in general, post-function executes after the transition (in this case Create transition). But my Group Picker is present in Create screen itself. That means the values must be filtered and available in Create screen itself (before the post-function) as per my groovy logic.

If I use 'Issue' object to set the custom field in my logic, the issue object is returning 'null' because the issue bject has not yet created in Create screen (before clicking on Create button).

The other way around I believe, this can be achieved is, we should be able to execute the logic when we click on Group Picker icon. Then it executes my logic and pulls out the filtered data on the Group Picker window. I am not sure how this can be achievable.



I am sorry, i missunderstood you.

If you already use Behaviours Groovy Script to filter the values, you should be able to set the value of the formfield with the following expressions:


def singleGroupCF = getFieldById("customfield_11111")

I hope that this approach will work.


Hi Thomas,

I tried the way you mentioned above. Seems the values are being set to the Group Picker field (values obtained from my logic are printing in the log). But when I click on the Group Picker icon, it seems, the Group Picker default query is executing and overriding my values in it. So, by default all the values are populating irrespective of my logic.

So I believe, there needs to be done something when we click on Group Picker icon.


There is currently no way to do it, if i read this correctly:

This was the raised issue to limit the user picker field to users from certain groups. Took only 9 years to solve.

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,177 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