I have two dropdown (select list - Single choice) fields "Internal Group" and "External Group" which I'd like to add on create screen. As per the project needs, users create tickets for field values of either of 'Internal Group' or 'External Group' field.
Options for fields:
Internal Group: A, B, C
External Group: 1, 2, 3
Let's say suppose I am creating a ticket for 'Internal Group' - A, I'd like to make 'Internal Group' as a required field and 'External Group' as an optional field and proceed with ticket creation.
Likewise, If I am creating a ticket for 'External Group' - 1, I'd like to make 'External Group' as required and 'Internal Group' as an optional field.
Can we in Jira add some logic so we can mark both fields as required and automatically make one of them optional based on value selected in other field?
Any groovy scripts to achieve this will also be of big help. Thanks!
I would probably use two different Issuetypes (Internal, External) and have different screen schemes for the two so you could have the appropriate field required.
Another consideration - use a cascading field:
and make the field required via the create transition validator.
You can use script runner behaviors to achieve this. https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html
No need to write any scripts if you have already have the plugin
First bullet point in the documentation
Making a field mandatory depending on other data entered on the issue screen (i.e during an issue creation or an issue transition)
Try using Workflow PowerBox app (if you have Jira on-prem). It has feature called "Validator Templates". you can create a template with 2 validators (one per field) and connect them with "Any of fillowing validators" operator.
Should work:) and you can define your own validation error messages as well.
Unlike ScriptRunners behaviours (great plugin anyway) validators work also when using REST API.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events