Based on one custom field value can we change the type of another custom field.

RM May 19, 2023

EX: If Change Type is single select list

Values: 1)Onboarding

2)Migration

If Change Type is Migration- Another custom field Customer Name should be a single select list that already has values to choose from.

If the Change Type is Onboarding- Customer Name custom field should be text box. Since onboarding new customers.

Please help me to achieve this. 

Thanks,

2 answers

1 vote
Graham Twine
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2023

Field types cannot be changed in Jira at all.

Only the name can be amended or values managed.

 

Do you have scriptrunner?

If so, the following would work.

 

By default the fields are both hidden.

When the value in the controlling field changes it will show / hide / toggle the other two.

NOTE: Do not give the other two the same name, duplicate names cause all sorts of trouble / confusion.

 

For a good user experience, keep the three fields together.

 

Solution 1

Change Type (Controls which of the two fields below will be displayed)

Existing Customer (Select List)

New Customer (Text Field)

Solution 2

A second solution would be to make the Existing Customer filed the controller.

Add a value "Other" to the select list

If the name I need is not in the predefined set of choices then I choose  "Other"

When "Other" is chosen a mandatory text field appears where I can capture the value

RM May 23, 2023

Hi @Graham Twine ,

I followed solution 1. But for future  New Customer (Text Field) value should be on the 

Existing Customer (Select List) if the customer create a ticket he should be able to choose that. Could you please help me how to achieve that. 

Thanks,
Rahul

Graham Twine
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2023

Hello @Rahul M

 

You would need to add the new Option from the text field to the list of available options.

 

See the OptionsManager in the java doc for assistance.

1. Create a new Option from the text field

2. Add a new Option list of options to the list of Options in the correct context

 

I do not think this is a good idea though.

Consider verifying things like the case, spaces etc You will end up with.

 

Option

option

my-option

My Option

1 vote
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 19, 2023

No, a field can be only one type and cannot be changed. You have to use two separate fields.

Are you already using two separate fields, and trying to set one or the other as required based on the value selected in the Change Type field?

Suggest an answer

Log in or Sign up to answer