While creating one issue in a project I want to make a field mandatory when I select the component as "Laptop Purchase". I have tried the code as below, but didn't work for me. import com.atlassian.jira.component.ComponentAccessordef optionsManager = ComponentAccessor.getOptionsManager()def customFieldManager = ComponentAccessor.getCustomFieldManager()def Laptoppurchase = getFieldById("customfield_29690")if (issue.components.name.contains("Laptop Purchase")) { Laptoppurchase.setRequired(true)} else { Laptoppurchase.setRequired(false) } Please help me here.