Hi I have a custom field which is a drop down menu(single select) with two options 'A' and 'B'. If I select A due date should be required otherwise not.
I am using the following code as a server side validation using Behaviours plugin
def Category log = Category.getInstance("com.onresolve.jira.groovy.postfunction");
log.warn("Test log statement"+getFieldByName("duedate"));
log.warn("Finished logging ---"+getFieldByName("End User").getValue()+" ------");
if(getFieldByName("End User").getValue() == "A")
But note you have nothing that sets the due date back to not required, if the user changes from option A to something else.
So remove your "if" block and use:
getFieldById("duedate").setRequired(getFieldByName("End User").getValue() == "A")
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG