How to set a field is required when another field value is set?

Pangianto Pang October 8, 2012

Hi, i have this request:

If "Fix Version" has value then some custom fields (more than one) are required

else they are optional field.

I have been looking round and round, i cannot find any clue.

Can anybody help me out?

3 answers

0 votes
Renjith Pillai
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.
October 14, 2012

And did you get a chance to look at Jamie's behaviour plugin?

https://studio.plugins.atlassian.com/wiki/display/JBHV/JIRA+Behaviours+Plugin

0 votes
Kai Gottschalk
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.
October 9, 2012

We had exactly the same problem: Dependency between two fields. One field has to contain a date if another field (select list) has the value set to "yes".

Fortunately we use the Scriptrunner (Groovy) already a lot and it solved also this requirement with some if-else lines of groovy-code. So if you (or someone close to you) have/has knowledge in JAVA/Groovy I'd definitely recommend to use that way - it works also in IE :-)

Cheers
Kai

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 8, 2012

You need some code to do this.

To do it properly, you'll need to find or write a "validator" that you can add to your workflow - see https://confluence.atlassian.com/display/JIRA/Configuring+Workflow#ConfiguringWorkflow-Applyingvalidatorstotransitions - I'd recommend a look at the "Jira scripting plugin" because it can simplify stuff like this and save you having to write swathes of plugins

You can also try to do this in javascript, but that won't work in later versions of Jira and the users can quite easily bypass it.

Pangianto Pang October 9, 2012

Ya, i have tried to use javascipt. It is working on Google Chrome but not IE7, my company is using IE7.

I am feeling so depressed.

I will try other method that you mentioned, thanks.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 9, 2012

The validator method is the better way to do it anyway, as it can't be bypassed.

You should be aware that your company needs to move off IE7 as well - it's obsolete, insecure and unsupported by an increasing number of applications (including the Atlassian suite)

Pangianto Pang October 9, 2012

The possibility of moving off from IE7 is not likely because a lot of applications in my company are developed long time ago and using IE7.

But thanks for your help. I think validator is a better idea.

Suggest an answer

Log in or Sign up to answer