Hello,
I would like to make a validator with simple scripted validator.
Parent Feature is the key of linked issue.
Internal Feature is a custom field, type Checkbox , It has one option- 'Yes'.
I have an error- java.lang.NullPointerException, and the code all the time return false.. What is the problem with my code ?
Thanks.
The code is:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
//get the parent feature issue
Issue featureT = ComponentAccessor.issueManager.getIssueObject('Parent Feature');
//custom field internal feature
def internal = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Internal Feature");
def selectedValues = internal.getValue(featureT);
def bool=true;
if(selectedValues!=null)
{
bool=true;
}
else
{
if(featureIssue.fixVersions != issue.fixVersions)
{
bool=false;
}
}
return bool;