当前位置: 首页>>代码示例>>Java>>正文


Java GlobalIssueContext类代码示例

本文整理汇总了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);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:15,代码来源:HubFieldScreenSchemeSetup.java

示例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);
	}

}
 
开发者ID:FraunhoferCESE,项目名称:HazardTrackingSystem,代码行数:51,代码来源:PluginCustomization.java


注:本文中的com.atlassian.jira.issue.context.GlobalIssueContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。