Hi All,
I got requirement like Create Two fields namely
1. Release notes needed (check box) values-- YES & No
2. Release notes (Text field)
Here my requirement is the ' Release notes needed mandatory field so while creating the ticket when I select Release notes needed vales is NO, the other field Release notes Needs to be hidden, If I select Release notes needed vales is Yes, the other field Release notes Needs to be visible as mandatory filed.
Please guide me with this requirement.
Thanks in advance
Hi Vikrant, Thanks for your reply,
If possible, Can you please provide me with the script for this requirement?
Thanks
Srinivas
Hi @Srinivas You can check the similar post for script :-
https://community.atlassian.com/t5/Jira-Software-questions/Scriptrunner-behavior/qaq-p/1442713
import com.atlassian.jira.issue.customfields.option.Option
def RE = getFieldById("customfield_14200")//put checkbox field id
def SF = getFieldById("customfield_14217") // put second field id
def options = RE.getValue()
//Single option selected
if(options instanceof String){
if(["Prod","Stage"].contains(options)){
SF.setRequired(true);
}
else{
SF.setRequired(false);
}
}
//Multiple options
else if(options instanceof List<Option> ){
if(options.contains("Prod") || options.contains("Stage") ){
SF.setRequired(true);
}
else{
SF.setRequired(false);
}
}
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Become an effective Jira admin
Manage global settings and shared configurations called schemes to achieve goals more quickly.
Streamline Jira administration with effective governance
Improve how you administer and maintain Jira and minimize clutter for users and administrators.
Learning Path
Become an effective Jira software project admin
Set up software projects and configure tools and agile boards to meet your team's needs.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.