Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How to set a custom field values based on request type?


I am using Jira Service Desk. I have a requirement that i have a three request types and i have a one custom field which is a drop down field.

Whenever a customer need to raise a request from customer portal I need to set the custom field options based on the selected request type in customer portal.

Note: Here i am not using any Customer Request Type Custom Field.

For example:

Request Types are : A, B and C
Custom field(Type is Drop Down Custom Field) has options like a,b,c,d,e,f g,h

If i select A request type the custom field will set to a,b,c

If i select B request type the custom field will set to d,e,f

If i select C request type the custom field will set to g,h.

Is there any script  to perform this operation.

Could anyone please help me with the appropriate solution.

Thanks in Advance

6 answers

Hi @DevaKiran @Luvo Hubela @Steven Miller @Stephen Letch @Mariano Battaglia ,

On a Jira Service Management Server environment of a customer of mine I solved it with a Behavior (app Scriptrunner).

The script that is used in the behaviour is

import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.component.ComponentAccessor

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def optionsManager = ComponentAccessor.getOptionsManager()

def selectList = getFieldById("customfield_12433")
def customField = customFieldManager.getCustomFieldObject(selectList.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)

def optionsMap = options.findAll {
it.value in ["Option A", "Option B"] // list of options you want to show
}.collectEntries {
(it.optionId.toString()): it.value


Is this an option/solution for you?


Hello @Marco Brundel

Facing the same issue but in Cloud.

Thanks for the code, but this will work only on Jira DC but what's the workaround for Jira Cloud as scriptrunner doesn't yet support behaviors option.

Please suggest if possible.


Hi @Adarsh Hegde ,

Sorry, but I don't know a solution/work around for the Cloud.

I think it would be a good idea to create a new question here on the community. Also because this question is tagged on Server.


greetings, Marco

Like Adarsh Hegde likes this

@Marco Brundel 

does this script work also on the Customer Portal side?

@Consulente Atlassian 
Yes, in my situation this behaviour works on a request type on the portal.

Hi there,

I have the same challenge. The solution with configuring new contexts to the custom field does not work here as you can only define a context depending on the issue type (and project).

What we look for is a solution that sets a new context depending on the customer request type  (which is NOT the issue type) in the help desk.

Does anyone has expecrience with that?

Thanks & regards!

I am facing the same issue and trying to find a solution. :(

Same here. Don't want to create additional fields. 

Very bad if you move issues from a -> b -> the fields are empty although the fields name maybe the same. Confusing stuff.



Someone solved it? thanks

No, probably have to use an initialiser with scriptrunner if you have it. Or if you're using Insight fields, have a hidden field and make the field on the portal a reference field

Excellent @Marco Brundel , thank you very much your comment helped me.

Anyone have a solution to this

Anyone have a solution for this? This is a pretty big deal breaker if it can't do something as simple as supplying custom fields based on request type.

Hi @DevaKiran ,

Try configuring a new custom field context for the issue types (request types) and define the various options for each custom field context.



Ravi Varma

Hi Ravi,

in the latest Version of Jira SD it is only possible to configure ONE context per project for each field. I was shocked to see this limitation because I was expecting that we can define as many different contexts for each field combined with different issue types. The configuration screen suggests this functionality, but as soon we start to configure a second context, the project that has been used iin a first confuguration is not available to select. 

This leads to a solution of the same semantic field beeing created as a custom fiel multiple times. Bad.

Any chance this could be implemented in future? Are there feature requests pending we could support?


Like Johannes likes this

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events