JiraAuthenticationContext authCtx = ComponentManager.getInstance()
.getJiraAuthenticationContext();
I18nHelper i18n = authCtx.getI18nHelper();
UserProjectHistoryManager userProjectHistoryManager = ComponentManager
.getComponentInstanceOfType(UserProjectHistoryManager.class);
Project currentProject = userProjectHistoryManager.getCurrentProject(
Permissions.BROWSE, authCtx.getLoggedInUser());
boolean isAutocompleteView;
if (cf.isAllProjects())
{
isAutocompleteView = qfMgr.isAutocompleteView(cf.getIdAsLong(),
Consts.PROJECT_ID_FOR_GLOBAL_CF); }
else
{
isAutocompleteView = qfMgr.isAutocompleteView(cf.getIdAsLong(),
currentProject.getId());
}
if (isAutocompleteView)
{
if ((params == null) || params.isEmpty())
{
boolean addNull;
if (cf.isAllProjects())
{
addNull = qfMgr.getAddNull(cf.getIdAsLong(),
Consts.PROJECT_ID_FOR_GLOBAL_CF);
}
else
{
addNull = qfMgr.getAddNull(cf.getIdAsLong(),
currentProject.getId());
}
if (!addNull)
{
errorCollection.addError(fieldConfig.getFieldId(),