Hi People,
We have two fields Defect Classification and Function Classification in one screen,
So if I select "Hardware Error" as my Defect Classification, the custom field Function Classification should not appear on the screen. I have implemented this in behaviours with below script. But I am not getting the correct output, even if I choose "Hardware error" still I can see Function Classification. May I know why I am not getting correct output.
The script follows:
import static com.atlassian.jira.issue.IssueFieldConstants.*
import com.atlassian.jira.component.ComponentAccessor;
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours behaviours
def defectclassification = getFieldById("customfield_15663")
def functionclassification = getFieldById("customfield_16663")
if (defectclassification == "Hardware Error") {
functionclassification.setHidden(true)
}
Hello @Sahish
could you try with
getFieldByName("customfield_15663").getValue())
instead of getFieldById("customfield_15663")
also, I've recommend to set as String instead of def.
Best regards.
Thanks for your response @Juan José Marchal Gómez . But I am getting the required output even after modification of the code with your changes.
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.