本文整理汇总了Java中com.atlassian.jira.workflow.JiraWorkflow类的典型用法代码示例。如果您正苦于以下问题:Java JiraWorkflow类的具体用法?Java JiraWorkflow怎么用?Java JiraWorkflow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JiraWorkflow类属于com.atlassian.jira.workflow包,在下文中一共展示了JiraWorkflow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVelocityParamsForView
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
@Override
protected void getVelocityParamsForView(Map velocityParams, AbstractDescriptor descriptor) {
if (!(descriptor instanceof ValidatorDescriptor)) {
throw new IllegalArgumentException("Descriptor must be a ValidatorDescriptor.");
}
ValidatorDescriptor validatorDescriptor = (ValidatorDescriptor) descriptor;
String script = (String) validatorDescriptor.getArgs().get(FIELD);
scriptManager.validateSyntax(script);
Map<String, String[]> myParams = ActionContext.getParameters();
JiraWorkflow jiraWorkflow = workflowManager.getWorkflow(myParams.get("workflowName")[0]);
velocityParams.put(FIELD, script);
velocityParams.put(LAST_AUTHOR, jiraWorkflow.getUpdateAuthorName());
velocityParams.put(LAST_UPDATE, jiraWorkflow.getUpdatedDate());
}
示例2: getVelocityParamsForView
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
@Override
protected void getVelocityParamsForView(Map<String, Object> velocityParams, AbstractDescriptor descriptor) {
if (!(descriptor instanceof FunctionDescriptor)) {
throw new IllegalArgumentException("Descriptor must be a FunctionDescriptor.");
}
FunctionDescriptor functionDescriptor = (FunctionDescriptor) descriptor;
String script = (String) functionDescriptor.getArgs().get(FIELD);
scriptManager.validateSyntax(script);
Map<String, String[]> myParams = ActionContext.getParameters();
JiraWorkflow jiraWorkflow = workflowManager.getWorkflow(myParams.get("workflowName")[0]);
velocityParams.put(FIELD, script);
velocityParams.put(LAST_AUTHOR, jiraWorkflow.getUpdateAuthorName());
velocityParams.put(LAST_UPDATE, jiraWorkflow.getUpdatedDate());
}
示例3: getVelocityParamsForView
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
@Override
protected void getVelocityParamsForView(Map velocityParams, AbstractDescriptor descriptor) {
if (!(descriptor instanceof ConditionDescriptor)) {
throw new IllegalArgumentException("Descriptor must be a ConditionDescriptor.");
}
ConditionDescriptor conditionDescriptor = (ConditionDescriptor) descriptor;
String script = (String) conditionDescriptor.getArgs().get(FIELD);
scriptManager.validateSyntax(script);
Map<String, String[]> myParams = ActionContext.getParameters();
JiraWorkflow jiraWorkflow = workflowManager.getWorkflow(myParams.get("workflowName")[0]);
velocityParams.put(FIELD, script);
velocityParams.put(LAST_AUTHOR, jiraWorkflow.getUpdateAuthorName());
velocityParams.put(LAST_UPDATE, jiraWorkflow.getUpdatedDate());
}
示例4: addHubWorkflowToJira
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
public JiraWorkflow addHubWorkflowToJira() {
try {
JiraWorkflow hubWorkflow = jiraServices.getWorkflowManager()
.getWorkflow(HubJiraConstants.HUB_JIRA_WORKFLOW);
if (hubWorkflow == null) {
final WorkflowDescriptor workflowDescriptor = getWorkflowDescriptorFromResource();
hubWorkflow = new ConfigurableJiraWorkflow(HubJiraConstants.HUB_JIRA_WORKFLOW, workflowDescriptor,
jiraServices.getWorkflowManager());
final ApplicationUser jiraAppUser = getJiraSystemAdmin();
if (jiraAppUser == null) {
logger.error("Could not find any JIRA System Admins to create the workflow.");
return null;
}
jiraServices.getWorkflowManager().createWorkflow(jiraAppUser, hubWorkflow);
logger.debug("Created the Hub Workflow : " + HubJiraConstants.HUB_JIRA_WORKFLOW);
}
return hubWorkflow;
} catch (final Exception e) {
logger.error("Failed to add the Hub JIRA worflow.", e);
settingService.addHubError(e, "addHubWorkflow");
}
return null;
}
示例5: addWorkflowToProjectsWorkflowScheme
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
public void addWorkflowToProjectsWorkflowScheme(final JiraWorkflow hubWorkflow, final Project project,
final List<IssueType> issueTypes) {
try {
final AssignableWorkflowScheme projectWorkflowScheme = jiraServices.getWorkflowSchemeManager()
.getWorkflowSchemeObj(project);
if (projectWorkflowScheme != null) {
final AssignableWorkflowScheme.Builder projectWorkflowSchemeBuilder = projectWorkflowScheme.builder();
boolean needsToBeUpdated = false;
if (issueTypes != null && !issueTypes.isEmpty()) {
for (final IssueType issueType : issueTypes) {
needsToBeUpdated = mapIssueTypeToBdsWorkflow(project, hubWorkflow, projectWorkflowScheme, projectWorkflowSchemeBuilder,
issueType, needsToBeUpdated);
}
}
if (needsToBeUpdated) {
jiraServices.getWorkflowSchemeManager().updateWorkflowScheme(projectWorkflowSchemeBuilder.build());
}
} else {
final String errorMessage = "Could not find the workflow scheme for the JIRA project : "
+ project.getName();
logger.error(errorMessage);
settingService.addHubError(errorMessage, null, null, project.getName(), null, null,
"addWorkflowToProjectsWorkflowScheme");
}
} catch (final Exception e) {
logger.error("Failed to add the Hub JIRA worflow to the Hub scheme.", e);
settingService.addHubError(e, null, null, project.getName(), null, null, "addWorkflowToProjectsWorkflowScheme");
}
}
示例6: mapIssueTypeToBdsWorkflow
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
private boolean mapIssueTypeToBdsWorkflow(final Project project, final JiraWorkflow hubWorkflow,
final AssignableWorkflowScheme projectWorkflowScheme, final AssignableWorkflowScheme.Builder projectWorkflowSchemeBuilder,
final IssueType issueType, boolean needsToBeUpdated) {
final String configuredWorkflowName = projectWorkflowScheme.getConfiguredWorkflow(issueType.getId());
final String actualWorkflowName = projectWorkflowScheme.getActualWorkflow(issueType.getId());
logger.debug("Configured workflow: " + configuredWorkflowName);
logger.debug("Actual workflow: " + actualWorkflowName);
if ((StringUtils.isBlank(actualWorkflowName)) || (!actualWorkflowName.equals(hubWorkflow.getName()))) {
projectWorkflowSchemeBuilder.setMapping(issueType.getId(), hubWorkflow.getName());
logger.debug("Updating JIRA Project : " + project.getName() + ", Issue Type : "
+ issueType.getName() + ", to the Hub workflow '" + hubWorkflow.getName() + "'");
needsToBeUpdated = true;
}
return needsToBeUpdated;
}
示例7: issueUsesBdsWorkflow
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
private boolean issueUsesBdsWorkflow(final Issue oldIssue) {
final JiraWorkflow issueWorkflow = jiraServices.getWorkflowManager().getWorkflow(oldIssue);
logger.debug("Issue " + oldIssue.getKey() + " uses workflow " + issueWorkflow.getName());
boolean isBdsWorkflow;
if (HubJiraConstants.HUB_JIRA_WORKFLOW.equals(issueWorkflow.getName())) {
isBdsWorkflow = true;
} else {
isBdsWorkflow = false;
}
return isBdsWorkflow;
}
示例8: adjustProjectsConfig
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
private void adjustProjectsConfig(final JiraServices jiraServices, final String projectMappingJson, final HubIssueTypeSetup issueTypeSetup,
final List<IssueType> issueTypes, final Map<IssueType, FieldScreenScheme> screenSchemesByIssueType, final EditableFieldLayout fieldConfiguration,
final FieldLayoutScheme fieldConfigurationScheme, final HubWorkflowSetup workflowSetup, final JiraWorkflow workflow) {
if (projectMappingJson != null && issueTypes != null && !issueTypes.isEmpty()) {
final HubJiraConfigSerializable config = new HubJiraConfigSerializable();
// Converts Json to list of mappings
config.setHubProjectMappingsJson(projectMappingJson);
if (!config.getHubProjectMappings().isEmpty()) {
for (final HubProjectMapping projectMapping : config.getHubProjectMappings()) {
if (projectMapping.getJiraProject() != null
&& projectMapping.getJiraProject().getProjectId() != null) {
// Get jira Project object by Id
// from the JiraProject in the mapping
final Project jiraProject = jiraServices.getJiraProjectManager()
.getProjectObj(projectMapping.getJiraProject().getProjectId());
if (jiraProject != null) {
// add issuetypes to this project
issueTypeSetup.addIssueTypesToProjectIssueTypeScheme(jiraProject, issueTypes);
issueTypeSetup.addIssueTypesToProjectIssueTypeScreenSchemes(jiraProject,
screenSchemesByIssueType);
final boolean wasAlreadySetUp = issueTypeSetup.associateIssueTypesWithFieldConfigurationsOnProjectFieldConfigurationScheme(
jiraProject, fieldConfigurationScheme, issueTypes, fieldConfiguration);
if (wasAlreadySetUp) {
logger.debug("It appears the project's WorkflowScheme has already been configured; leaving it unchanged");
} else {
workflowSetup.addWorkflowToProjectsWorkflowScheme(workflow, jiraProject, issueTypes);
}
}
}
}
}
}
}
示例9: testAddHubWorkflowToJira
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
@Test
public void testAddHubWorkflowToJira() {
final PluginSettingsMock settingsMock = new PluginSettingsMock();
final JiraSettingsService settingService = new JiraSettingsService(settingsMock);
final WorkflowManagerMock workflowManager = new WorkflowManagerMock();
final WorkflowSchemeManagerMock workflowSchemeManager = new WorkflowSchemeManagerMock();
final String jiraUserName = "FakeUser";
final UserUtilMock userUtil = new UserUtilMock();
final ApplicationUserMock user = new ApplicationUserMock();
user.setName(jiraUserName);
userUtil.setUser(user);
final JiraServicesMock services = new JiraServicesMock();
services.setWorkflowManager(workflowManager);
services.setWorkflowSchemeManager(workflowSchemeManager);
services.setUserUtil(userUtil);
final HubWorkflowSetup workflowSetup = new HubWorkflowSetup(settingService, services);
final JiraWorkflow workflow = workflowSetup.addHubWorkflowToJira();
assertNotNull(workflow);
assertTrue(workflowManager.getAttemptedCreateWorkflow());
assertNull(settingsMock.get(HubJiraConstants.HUB_JIRA_ERROR));
}
示例10: jiraSetup
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
public void jiraSetup(final JiraServices jiraServices, final JiraSettingsService jiraSettingsService,
final String projectMappingJson, final TicketInfoFromSetup ticketInfoFromSetup,
final JiraContext jiraContext)
throws ConfigurationException, JiraException {
// Make sure current JIRA version is supported
getJiraVersionCheck(); // throws exception if not
// Create Issue Types, workflow, etc.
HubIssueTypeSetup issueTypeSetup;
try {
issueTypeSetup = getHubIssueTypeSetup(jiraSettingsService, jiraServices, jiraContext.getJiraAdminUser().getName());
} catch (final ConfigurationException e) {
logger.error("Unable to create IssueTypes; Perhaps configuration is not ready; Will try again next time");
return;
}
final List<IssueType> issueTypes = issueTypeSetup.addIssueTypesToJira();
if (issueTypes == null || issueTypes.isEmpty()) {
logger.error("No Black Duck Issue Types found or created");
return;
}
logger.debug("Number of Black Duck issue types found or created: " + issueTypes.size());
final HubFieldScreenSchemeSetup fieldConfigurationSetup = getHubFieldScreenSchemeSetup(
jiraSettingsService,
jiraServices);
final Map<IssueType, FieldScreenScheme> screenSchemesByIssueType = fieldConfigurationSetup
.addHubFieldConfigurationToJira(issueTypes);
if (screenSchemesByIssueType == null || screenSchemesByIssueType.isEmpty()) {
logger.error("No Black Duck Screen Schemes found or created");
}
ticketInfoFromSetup.setCustomFields(fieldConfigurationSetup.getCustomFields());
logger.debug("Number of Black Duck Screen Schemes found or created: " + screenSchemesByIssueType.size());
final HubFieldConfigurationSetup hubFieldConfigurationSetup = getHubFieldConfigurationSetup(jiraSettingsService,
jiraServices);
final EditableFieldLayout fieldConfiguration = hubFieldConfigurationSetup.addHubFieldConfigurationToJira();
final FieldLayoutScheme fieldConfigurationScheme = hubFieldConfigurationSetup
.createFieldConfigurationScheme(issueTypes, fieldConfiguration);
final HubWorkflowSetup workflowSetup = getHubWorkflowSetup(jiraSettingsService, jiraServices);
final JiraWorkflow workflow = workflowSetup.addHubWorkflowToJira();
logger.debug("Black Duck workflow Name: " + workflow.getName());
// Associate these config objects with mapped projects
adjustProjectsConfig(jiraServices, projectMappingJson, issueTypeSetup, issueTypes, screenSchemesByIssueType, fieldConfiguration,
fieldConfigurationScheme, workflowSetup, workflow);
}
示例11: addWorkflow
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
public void addWorkflow(final JiraWorkflow jiraWorkflow) {
workflowMap.put(jiraWorkflow.getName(), jiraWorkflow);
}
示例12: copyWorkflow
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
@Override
public JiraWorkflow copyWorkflow(final String arg0, final String arg1, final String arg2, final JiraWorkflow arg3) {
return null;
}
示例13: createDraftWorkflow
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
@Override
public JiraWorkflow createDraftWorkflow(final String arg0, final String arg1)
throws IllegalStateException, IllegalArgumentException {
return null;
}
示例14: createWorkflow
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
@Override
public void createWorkflow(final ApplicationUser arg0, final JiraWorkflow arg1) throws WorkflowException {
attemptedCreateWorkflow = true;
}
示例15: getActiveWorkflows
import com.atlassian.jira.workflow.JiraWorkflow; //导入依赖的package包/类
@Override
public Collection<JiraWorkflow> getActiveWorkflows() throws WorkflowException {
return null;
}