Display field values based on selection if another field value
Asked by Vinay Humility:

Hi All,

i have 2 custom fields in my portal form jira cloud

Field1 - 1,2,3 values

Field2 - 4,5,6,7 values

when customer selects option 1 in Field1 then customer should only see 4,5 as options in Field2

i tried using Jira Cloud Script Runner using behaviours. But unfortunately its not working for me.


Answers:
author: Kevin Patterson
body: Hi [@Vinay Humility](/t5/user/viewprofilepage/user-id/5545233) ,

If you are a JSM premium customer you could use Assets to accomplish this. I have an assets schema that has a few object types that I use for the sole purpose of driving dynamic field behaviors like you mentioned above. In your example your schema would look something like this:

![2024-07-18_10-59-56.png](https://community.atlassian.com/t5/image/serverpage/image-id/336424iE62F9CEB418EE433/image-size/large?v=v2&px=999 "2024-07-18_10-59-56.png")

You can then create custom fields of the asset type. custom Field 1 should be configured to show all objects from the field 1 object type. custom Filed 2 should be configured to show only objects that have a reference to the object in from the selection in custom field 1 using the filter issue scope AQL. The tricky part can be the filter issue scope. on your second custom field you will want to add a filter issue scope that will look at the custom field containing values 1,2,3 and lookup the inbound references, I've copied a screenshot below that shows how this would look below. let us know if you have any questions on this approach.

![filterissue.png](https://community.atlassian.com/t5/image/serverpage/image-id/336425iF702D7ED0EDE37DC/image-size/large?v=v2&px=999 "filterissue.png")

here is the end result. selecting value 1 in example dynamic field 1 limits the values in example dynamic field 2 to only showing 4,5.

![results.png](https://community.atlassian.com/t5/image/serverpage/image-id/336426i248EEE1D6AC6D692/image-size/large?v=v2&px=999 "results.png")

comments: author: Bhanu Prakash
body: [@Kevin Patterson](/t5/user/viewprofilepage/user-id/5497084) Thanks for your response.

Apologies, but we are small company recently started using JIRA Cloud. Not using the Premium for not atleast. WOrking on Standard plan itself.

Is there any other way works in Jira Cloud standard plan


author: Kevin Patterson
body: Not natively, at least not that I have found yet. If you have low user count it might be worth investigating the Atlassian Marketplace for an application that provides Dynamic field capabilities, this could a more cost effective alternative than upgrading to JSM Premium.


author: sharos_pillai
body: Hi [@Kevin Patterson](/t5/user/viewprofilepage/user-id/5497084) , I want to setup something similar using Assets.

In the drop-down list, there are 4 options.

When a user selects Option 4 from the drop down, I want to show a new custom field (movement type) on the request form.

When users select Option 1 to 3, this custom field is not shown.

Does the above method work?

Thanks

SP


author: Nicolas Grossi
body: [@Vinay Humility](/t5/user/viewprofilepage/user-id/5545233) You might take a look at this thread: <https://community.atlassian.com/t5/Jira-questions/how-to-create-dependent-drop-down-list/qaq-p/925398>

Nicolas

comments: author: Vinay Humility
body: Thanks [@Nicolas Grossi](/t5/user/viewprofilepage/user-id/676185) for the response

i have reviewed the link

I am aware that it can be achievable with Script Runner Using Behaviour Script. But the link you shared was about jira data center and I am using jira cloud.   
also i got to know that behaviour in jira cloud uses only JS code, if we are trying to write groovy its not allowing to save the code..


Tags: cloud

jira-service-management

jira-service-management-cloud