The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Validator based on a field in screen

Marzi Goodarzian
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 Champions.
January 20, 2020

Hello 

Is ther a solution for my task?

if value of field 1 is "x"

then Field 2 , 3 ae requirement.

else if

value of field 1 is "y"

then field4 ,5 are requirement.

requirement fields based on an another field value in screen.

thanks for your time

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Ganesh Babu
Community Champion
January 20, 2020

Hi @Marzi Goodarzian 

As you are on a server the Scriptrunner add-on allows you this feature.

You can use behaviour and a script on a field in behaviour to achieve what you want.

Scriptrunner: https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner/server/overview
Behaviours doc: https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html

For code to set required based on another field - se answer in: https://community.atlassian.com/t5/Answers-Developer-Questions/ScriptRunner-Issues-with-required-custom-field-based-on-another/qaq-p/546310

Hope this helps.

Regards,

Ganesh Babu J

Marzi Goodarzian
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 Champions.
January 20, 2020

Hi @Ganesh Babu 

Thanks

Ganesh Babu
Community Champion
January 20, 2020

@Marzi Goodarzian  But following to that link i suggest you to use "else if" and "else" after "if", as in your case based on the two values you have conditions to be met.