I have a custom field (Component) and a second custom field (Sub-Component) that is only entered if the first is filled. I've been asked to make the Component field mandatory in two projects, and the sub-component field mandatory in only one project.
The info may not be known at issue creation, so I tried to create a validation and then a condition on the transition out of the first status. However, that didn't give an error to the user; the transition just didn't appear as an option.
Other than buying an add-on, what else can I try?
There are generally 2 ways to make a field mandatory.
1: Require the field in a validator. (this will only make it mandatory when you try to execute the specific transition the validator is on)
(note, condition - transition wont even appear unless the condition is true. Validator - Transition will be a option, but will not be able to be completed unless the validator is true. Validators usually used with a transition screen) So dont use a condition.
2: Make it required in the field configuration. This will make it required any time it appears on the screen.
So you could set up 2 different field configurations, one for each project. And on 1 make just component required, and on the other make both mandatory.
However, since you said that issue create time, the component may not be known, you want to make sure that it is not present on the create screen. Else you will unable to create the issue without filling in the data
Start with what reports people want to generate, and how those reports will actually make a different to the company. I would suggest to them that they can not use Sub-Component, but instead name the components better, something like this:
Component A - Sub Component 1
Component A - Sub Component 2
Component B - Sub Component 1
Component B - Sub Component 2
Otherwise you are in a hard technical place, perhaps using the ScriptRunner plugin?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.