Forums

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

How to make fields mandatory on different screens

Arunajyothi Samala September 11, 2023

Hi, Team 

I have 43 new fields in a Project which has one issue type. 
We have ScriptRunner Behaviour  logic for fields to pop up on user input. 
1. 5th field, this is number field, if the user inputs >20,000, next 10 fields pop up, if it <20,00 only three fields
2. 18th field, Yes/No Single select drop down, if user selects "yes", next 10 fields pops up
3. same as 2nd point for another field.

Now the problem is,

We have workflow statuses as To-Do>Submitted>Approved>Denied>Re-open.

1. When the user is moving the issue from "To-do" to "Submitted", I want to make the fields that user selected as required. How Do I store user input while creating and making it required during the transition?
2. When the user is moved to "submitted", all the fields the user gave input should be read-only, Fields shouldn't be editable once it is submitted. 

2 answers

0 votes
Arunajyothi Samala September 12, 2023

Hi,

Thank you for the response.

As I said above we have a ScriptRunner Behaviour to pop up the fields based on user input.

So how do I check those fields populated based on user input, have them on transition screen and add a Field required validator??

*I need to check what fields are present on the Edit screen, make all fields on that screen mandatory with a validator/transition screen to pop up for users*

Arunajyothi Samala September 12, 2023
Vishal
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.
September 12, 2023

Hi @Arunajyothi Samala 

Yes exactly, you should have those fields on the transition screen & have a validator, if they are already filled, those values would be there on the transition screen as well & will allow user to change the status. But if they are empty the validator will throw error to user & they'll get to see that the fields are empty & needs to be filled.

Arunajyothi Samala September 12, 2023

@Vishal But what fields should I add to the transition screens,

in all 43 fields, there is a behavior logic that pop ups the fields.

1.5th field, this is number field, if the user inputs >20,000, next 10 fields pop up, if it <20,000 only three fields

2. 18th field, Yes/No Single select drop down, if user selects "yes", next 10 fields pop up
3. 29tth field, Yes/No Single select drop down, if user selects "yes", next 10 fields pop up

The solution you offered is

1. have all fields on transition screen, add required field validator for 43 fields

But I am missing out at if the user inputs <20,000 we will not have all those fields right on view screen, but still the field will be present on transition screen and validator will throw a error 

Vishal
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.
September 12, 2023

Hi @Arunajyothi Samala 

Ah, I missed that part of your question, you need to make those field mandatory as soon as they popup then using your scriptrunner behaviour, you cant make them mandatory at the transition as they are not static & depends on the selection of another field.

Hope this clarifies.

Vishal

0 votes
Vishal
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.
September 12, 2023

Hi @Arunajyothi Samala 

Please find answers to your questions below :

1. Add the transition screen in a particular transition & make the fields available which you want to set as mandatory on it, so that they'll be available for users to fill, in case they haven't filled. Also, use field validator in the same transition & set them as mandatory & this will force users to fill them & will throw error & stop them from going to next status if empty.

2. To make the fields read only at particular status, you can user workflow property as below :

Property Key = jira.issue.editable

Property Value = false

Hope this helps

Suggest an answer

Log in or Sign up to answer