Hello,
Can somebody help me with this. I need to hide custom filed type (html) when issue arrives in certain status.
I'm trying to do that with Behaviors plugin as following
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.user.ApplicationUser
import com.onresolve.jira.groovy.user.FieldBehaviours
ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cField = getFieldById("customfield_12345")
if (Issue.getStatus() == "TOTO"){
cField.setHidden(true)
}
else {
cField.setHidden(false)
}
But in does not work. I have configure the behavior to my project and custom field as in example here https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html?utm_source=product-help
What I'm doing wrong ?
Thanks in advance !
Look here for an example of code: https://community.atlassian.com/t5/Jira-questions/Copy-custom-field-user-object-to-sub-task-using-script-runner/qaq-p/618384
It comes from this part in the documentation https://docs.adaptavist.com/sr4js/latest/features/behaviours/behaviours-examples/sub-task-default-field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.