本文整理汇总了Java中com.atlassian.jira.issue.context.GlobalIssueContext类的典型用法代码示例。如果您正苦于以下问题:Java GlobalIssueContext类的具体用法?Java GlobalIssueContext怎么用?Java GlobalIssueContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GlobalIssueContext类属于com.atlassian.jira.issue.context包,在下文中一共展示了GlobalIssueContext类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCustomField
import com.atlassian.jira.issue.context.GlobalIssueContext; //导入依赖的package包/类
private CustomField createCustomField(final List<IssueType> issueTypeList, final String fieldName)
throws GenericEntityException {
logger.debug("createCustomField(): " + fieldName);
final CustomFieldType fieldType = jiraServices.getCustomFieldManager()
.getCustomFieldType(CreateCustomField.FIELD_TYPE_PREFIX + "textarea");
final CustomFieldSearcher fieldSearcher = jiraServices.getCustomFieldManager()
.getCustomFieldSearcher(CreateCustomField.FIELD_TYPE_PREFIX + "textsearcher");
final List<JiraContextNode> contexts = new ArrayList<>();
contexts.add(GlobalIssueContext.getInstance());
return jiraServices.getCustomFieldManager().createCustomField(fieldName, "", fieldType, fieldSearcher, contexts,
issueTypeList);
}
示例2: PluginCustomization
import com.atlassian.jira.issue.context.GlobalIssueContext; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
private PluginCustomization() throws GenericEntityException {
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
List<JiraContextNode> contexts = new ArrayList<JiraContextNode>();
contexts.add(GlobalIssueContext.getInstance());
// Check if this issue type already exists.
IssueTypeManager issueTypeManager = ComponentAccessor.getComponent(IssueTypeManager.class);
IssueType found = null;
Iterator<IssueType> iterator = issueTypeManager.getIssueTypes().iterator();
while (found == null && iterator.hasNext()) {
IssueType next = iterator.next();
if (next.getName().equals(ISSUE_TYPE_NAME)) {
found = next;
logger.info(ISSUE_TYPE_NAME + " already exists.");
}
}
if (found == null) {
logger.info(ISSUE_TYPE_NAME + " does not yet exist. Creating new issue type for HTS hazards.");
this.hazardIssueSubType = issueTypeManager.createSubTaskIssueType(ISSUE_TYPE_NAME,
"A Hazard sub-task issue type for the HTS plugin.",
"/images/icons/issuetypes/subtask_alternate.png");
List<GenericValue> issueTypes = new ArrayList<GenericValue>();
issueTypes.add(hazardIssueSubType.getGenericValue());
CustomFieldType textFieldType = customFieldManager
.getCustomFieldType("com.atlassian.jira.plugin.system.customfieldtypes:textfield");
CustomFieldType urlFieldType = customFieldManager
.getCustomFieldType("com.atlassian.jira.plugin.system.customfieldtypes:url");
CustomFieldSearcher fieldSearcher = customFieldManager
.getCustomFieldSearcher("com.atlassian.jira.plugin.system.customfieldtypes:textsearcher");
this.hazardNumberField = customFieldManager.createCustomField(HAZARD_NUMBER_FIELD_NAME, null,
textFieldType, fieldSearcher, contexts, issueTypes);
this.hazardTitleField = customFieldManager.createCustomField(HAZARD_TITLE_FIELD_NAME, null, textFieldType,
fieldSearcher, contexts, issueTypes);
this.hazardURLField = customFieldManager.createCustomField(HAZARD_URL_FIELD_NAME, null, urlFieldType,
fieldSearcher, contexts, issueTypes);
} else {
this.hazardIssueSubType = found;
this.hazardNumberField = customFieldManager.getCustomFieldObjectByName(HAZARD_NUMBER_FIELD_NAME);
this.hazardTitleField = customFieldManager.getCustomFieldObjectByName(HAZARD_TITLE_FIELD_NAME);
this.hazardURLField = customFieldManager.getCustomFieldObjectByName(HAZARD_URL_FIELD_NAME);
}
}