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

Automatically add dropdown value to the main field

Srinivas April 21, 2023

Hi All,

 

I have one query.

So, we have two fields with same name, but field type is different.

Field name- Project name (Single choice and text box)

 

1. Project name (choice) have dropdowns like "Project 1", "Project 2", "Project 3" and "Other"

2. Project name- Text box.

 

When I select "Other" in the 1.Project name (Choice) and 2.Project name (text) should be populated in creating screen---- I achieved this with small behaviors.

 

Here, my challenge is When I type new value in 2.Project name (text) field, it must be automatically added in the 1.Project name (choice) field as a drop down, it should be visible next time while creating ticket along with my previous options.

 

Is this possible? Any automation available? Someone please guide me how to achieve this one.

Thanks in advance.

 

Regards,

Srinivas

1 comment

Comment

Log in or Sign up to comment
Radek Dostál
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.
April 21, 2023

https://library.adaptavist.com/entity/update-select-list-options-from-new-client-request this might get you started

Jira has no thing for this so this does need to be scripted. Ideally as a post-function because you wouldn't want to populate the list during the create, since the user could enter a tons of weird strings before they finally submit the issue.

I don't really like the code there too much (a bit bare bones?) and I think that it should be

companyField.getRelevantConfig(issue)
// instead of companyField.getRelevantConfig(IssueContext.GLOBAL)

since you're guaranteed to get the correct FieldConfig and not just rely on "global" being the right fit, but oh well, it's verified

TAGS
AUG Leaders

Atlassian Community Events