Display custom field depends of selected component.
For expample.
Component web
Component wap
For component web i need to show customField1
def s = getComponentByName(componentName);
def d = customField1 // for web
if (componentName = "web")
d.setHidden(true);
else
d.setHidden(false);
log.error(s);
log.error(d);
import com.atlassian.jira.bc.project.component.ProjectComponent import com.onresolve.jira.groovy.user.FieldBehaviours import groovy.transform.BaseScript @BaseScript FieldBehaviours behaviours def cf = getFieldByName("Some Field") def components = getFieldById("components").getValue() as List<ProjectComponent> cf.setHidden(components.any {it.name == "web"})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As an admin, goto Administration -> issues -> customfields -> copy link location from the edit button
it should look something like this: https://your.jira.address./secure/admin/EditCustomField!default.jspa?id=10101
There is the ID in the URL.
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.
Problem solved:
init script
def s = getFieldByName("customField1");
s.setHidden(true);
validation script
def s = getFieldById(fieldChanged);
def d = getFieldByName("customField1");
if (s.getValue().get(0).getName().equals("web"))
d.setHidden(false);
else
d.setHidden(true);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
that will throw an exception when a component is removed and it's empty
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.