Hi,
I would like to be able to open another field according to a ceratin choice.
For example:
Resolving a bug screen. you can choose from a multiple options (Fixed, Won't Fix, Not a Bug, Duplicate, etc...)
Lets say you choosed "Duplicate"
If you choose "Duplicate" i want a new field to be opened - "Linked Issues" so you can link the current issue the the duplicated one.
The "Linked Issue" field will be hidden in the screen and will appear only if you choose "Duplicate".
You can do all this with javascript but in my opinion it's fragile, likely to break when jira is upgraded, and difficult to test due to the fact that custom field IDs will invariably be different from dev to uat, and uat to prod.
If you use the behaviours plugin you can add a new behaviour, add the Resolution field, click "add server script", paste in:
FormField res = getFieldById(getFieldChanged()) FormField links = getFieldById("issuelinks") if (res.getFormValue() == "3") { // duplicate links.setRequired(true).setHidden(false) if (! links.getFormValue()) { links.setHelpText("Please enter the duplicated issue.") } } else { links.setHelpText("") links.setRequired(false).setHidden(true) }
then apply the behaviour to the project.
BTW, support for the "issue links" system field was only added recently, I have not tested much.
Working like a charm!
If anyone else want to use it, just don't forget to add the "Linked Issues" field to the desired screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One more thing, for some reason the field is "Required"
although i didn't set it to be (i want it to be "Optional")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.