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: 

Need two dependency fields.

Srinivas
October 14, 2022

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

1 comment

Comments for this post are closed

Community moderators have prevented the ability to post new comments.

Vikrant Yadav
Community Champion
October 14, 2022

Hi @Srinivas  Welcome to Atlassian Community!

For this scenario, you need ScriptRunner plugin.  If you have this plugin, you can add Script Runner behavior on Release notes needed checkbox field. 

 

Thanks

V.Y

Srinivas
October 14, 2022

Hi Vikrant, Thanks for your reply,

 

If possible, Can you please provide me with the script for this requirement?

 

Thanks

Srinivas

Vikrant Yadav
Community Champion
October 14, 2022

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);
}
}
TAGS
AUG Leaders

Atlassian Community Events