Hi,
I am trying to hide 4 fields ( project lead, design author, contributor and consultant) from the project based on assignee using behaviors in JIRA
I added field under behavior as "Assignee" as optional, writable and shown and then wrote this server-side script
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
def assignee = getFieldById("assignee")
def ProjectLead = getFieldById("customField_21153")
def DesignAuthor = getFieldById("customField_21154")
def Contributors = getFieldById("customField_21155")
def Consultants = getFieldById("customField_21156")
log.debug("Assignee " + assignee.getValue())
if (assignee.getValue() == "backlog-server-storage-engines") {
ProjectLead.setHidden(false);
DesignAuthor.setHidden(false);
Contributors.setHidden(false);
Consultants.setHidden(false);
}
else
{
ProjectLead.setHidden(true);
DesignAuthor.setHidden(true);
Contributors.setHidden(true);
Consultants.setHidden(true);
}
This is not working, can someone suggest what am i doing wrong? Thanks