private List<Option> getIssueTypeOptionsList(final Collection<IssueTypeBean> values) { MutableIssue issue = getMutableIssue(); List<Option> result = Lists.newArrayList(); if(values != null){ for (IssueTypeBean value : values) { final boolean isSelected = StringUtils.isNotEmpty(issueType) ? StringUtils.equalsIgnoreCase(issueType, value.getName()) : StringUtils.equalsIgnoreCase(value.getName(), issue.getIssueTypeObject().getName()); result.add(new Option(value.getName(), isSelected)); } } return result; }
issuesInContext.put(new IssueContextImpl(issue.getProjectObject(), issue.getIssueTypeObject()), issue);
@SuppressWarnings ("UnusedDeclaration") public String getCustomFieldHtml() { final CustomField customField = getCustomField(); FieldConfig config = getFieldConfig(); Map displayParameters = MapBuilder.build( "defaultScreen", "true", "objectValue", customField.getCustomFieldType().getDefaultValue(config)); // Sees if we can set some values in the issue MutableIssue dummyIssue = getDummyIssue(); FieldLayoutItem fieldLayoutItem = null; // See if we can get a field layout item using the dummy issue try { if(dummyIssue.getProjectObject() != null && dummyIssue.getIssueTypeObject() != null) { FieldLayout fieldLayout = fieldLayoutManager.getFieldLayout(dummyIssue.getProjectObject(), dummyIssue.getIssueTypeId()); fieldLayoutItem = fieldLayout.getFieldLayoutItem(config.getCustomField().getId()); } } catch(DataAccessException ex) { // warn the user and move on with a null FieldLayoutItem log.warn("Unable to resolve a field layout item when setting the default value of custom field with id: " + config.getCustomField().getId(), ex); } return customField.getCustomFieldType().getDescriptor().getEditDefaultHtml(config, fieldValuesHolder, dummyIssue, this, displayParameters, fieldLayoutItem); }
issueObject.getIssueTypeObject().getId())); final Options options = customField.getOptions(null, fieldConfig, new ProjectContext(projectId));