Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Making fields and sub-fields mandatory

Deleted user March 31, 2020

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?

2 answers

1 accepted

0 votes
Answer accepted
Andrew Laden
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 1, 2020

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

0 votes
Matt Doar
Community Champion
March 31, 2020

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?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events