Hello there,
We are using three fields in the create screen and they are
Upgrade (single select single choice), values are None, Yes, No, SC and ST ("customfield_1112")
Base version (text field single line) ("customfield_113")and
Final version (text field single line) ("customfield_114")
When the Upgrade value is other than None, I need the Base version and Final version fields to be filled in. If the Upgrade value is None, there is no need for the required field. Please assist me with this; I'm new to scripts and your assistance is greatly appreciated. Please let me know if you need any information on this.
Note: We are using the Scrip runner plugin in my server instance and help me how to solve this issue.
Thanks,
Siv.
Hi @siva
Check out the answer in https://community.atlassian.com/t5/Adaptavist-questions/ScriptRunner-behaviour-for-hiding-a-field-based-on-another/qaq-p/1755119 and use
.setRequired(true)
as required for your use case.
Trying scripting as a newbie could be daunting.. But trust me, once you are able to understand the given script and modify it for your use case, it opens many doors :)
Hi @siva Kindly try to apply Behaviour on Upgrade field.
As suggest by @Fazila Ashraf , you only need to replace .setHidden with .setRequired
def dropDown = getFieldById("customfield_12345")//Change field ID as per your instance
//define base version field
def baseVersion = getFieldById("customfield_67891") //Change field ID as per your instance
//define Final Version field
def finalVersion = getFieldById("customfield_66666") //Change field ID as per your instance
//apply condition on select list field
if(dropDown.getValue()== "None"){
baseVersion.setRequired(true)
finalVersion.setRequired(true)
} else {
baseVersion.setRequired(false)
finalVersion.setRequired(false)
}
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.