private String getCreateOrEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, Action action, Issue issue, Map displayParameters, final Boolean create)
{
IssueLinkDisplayHelper issueLinkDisplayHelper = new IssueLinkDisplayHelper(userHistoryManager, authenticationContext.getUser());
Map<String, Object> velocityParams = getVelocityParams(fieldLayoutItem, action, issue, displayParameters);
velocityParams.put(PARAMS_ISCREATEISSUE, create);
final Object value = operationContext.getFieldValuesHolder().get(getId());
velocityParams.put("value", value);
velocityParams.put("linkTypes", issueLinkDisplayHelper.getSortedIssueLinkTypes(issueLinkService.getIssueLinkTypes()));
velocityParams.put("selectedLinkType", issueLinkDisplayHelper.getLastUsedLinkType());
if (value != null && value instanceof IssueLinkingValue)
{
final IssueLinkingValue ilv = (IssueLinkingValue) value;
if (StringUtils.isNotBlank(ilv.getLinkDescription()))
{
velocityParams.put("selectedLinkType", ilv.getLinkDescription());
}
}
return renderTemplate("issuelinks-edit.vm", velocityParams);
}