本文整理汇总了Java中com.atlassian.jira.component.ComponentAccessor.getIssueManager方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentAccessor.getIssueManager方法的具体用法?Java ComponentAccessor.getIssueManager怎么用?Java ComponentAccessor.getIssueManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.atlassian.jira.component.ComponentAccessor
的用法示例。
在下文中一共展示了ComponentAccessor.getIssueManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIssueManager
import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
public IssueManager getIssueManager() {
return ComponentAccessor.getIssueManager();
}
示例2: update
import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Hazards update(int hazardID, String hazardNumber, String version, String hazardTitle,
Subsystems[] subsystems, Review_Phases reviewPhase, Mission_Phase[] missionPhases,
Hazard_Group[] hazardGroups, String safetyRequirements, String description, String justification,
String openWork, Date initiation, Date completion) {
Hazards hazard = getHazardById(hazardID);
PluginCustomization pluginCustomization = null;
try {
// Update issue in JIRA ITS
pluginCustomization = PluginCustomization.getInstance();
IssueManager issueManager = ComponentAccessor.getIssueManager();
CustomField hazardNumberField = pluginCustomization.getHazardNumberField();
hazardNumberField.getCustomFieldType().updateValue(hazardNumberField,
issueManager.getIssueObject(hazard.getIssueID()), hazardNumber);
CustomField hazardTitleField = pluginCustomization.getHazardTitleField();
hazardTitleField.getCustomFieldType().updateValue(hazardTitleField,
issueManager.getIssueObject(hazard.getIssueID()), hazardTitle);
} catch (GenericEntityException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
// Update hazard in HTS
hazard.setHazardNumber(hazardNumber);
hazard.setHazardVersionNumber(version);
hazard.setHazardTitle(hazardTitle);
hazard.setRevisionDate(new Date());
ao.delete(ao.find(SubsystemToHazard.class, Query.select().where("HAZARD_ID=?", hazard.getID())));
if (subsystems != null) {
for (Subsystems subsystem : subsystems) {
final SubsystemToHazard subsystemToHazard = ao.create(SubsystemToHazard.class);
subsystemToHazard.setSubsystem(subsystem);
subsystemToHazard.setHazard(hazard);
subsystemToHazard.save();
}
}
hazard.setReviewPhase(reviewPhase);
ao.delete(ao.find(PhaseToHazard.class, Query.select().where("HAZARD_ID=?", hazard.getID())));
if (missionPhases != null) {
for (Mission_Phase phase : missionPhases) {
final PhaseToHazard phaseToHazard = ao.create(PhaseToHazard.class);
phaseToHazard.setMissionPhase(phase);
phaseToHazard.setHazard(hazard);
phaseToHazard.save();
}
}
ao.delete(ao.find(GroupToHazard.class, Query.select().where("HAZARD_ID=?", hazard.getID())));
if (hazardGroups != null) {
for (Hazard_Group group : hazardGroups) {
final GroupToHazard hazardGroupToHazard = ao.create(GroupToHazard.class);
hazardGroupToHazard.setHazardGroup(group);
hazardGroupToHazard.setHazard(hazard);
hazardGroupToHazard.save();
}
}
hazard.setHazardSafetyRequirements(safetyRequirements);
hazard.setHazardDescription(description);
hazard.setHazardJustification(justification);
hazard.setHazardOpenWork(openWork);
hazard.setInitiationDate(initiation);
hazard.setCompletionDate(completion);
hazard.save();
return hazard;
}
示例3: getAllHazardsByMissionID
import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
@GET
@Path("hazards/{missionID}")
@Produces({ MediaType.APPLICATION_JSON })
public Response getAllHazardsByMissionID(@PathParam("missionID") Long missionID) {
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getUser();
if (user == null) {
return ResponseHelper.notLoggedIn();
}
if (missionID == null) {
return ResponseHelper.badRequest("Invalid missionID");
}
if (!hazardService.hasHazardPermission(missionID, user)) {
return ResponseHelper.forbidden("User does not have permission to access hazard reports for that project");
}
List<HazardMinimal> hazards = Lists.newArrayList();
ProjectManager projectManager = ComponentAccessor.getProjectManager();
IssueManager issueManager = ComponentAccessor.getIssueManager();
for (Hazards hazard : hazardService.getHazardsByProjectId(missionID)) {
hazards.add(HazardMinimal.create(hazard, projectManager.getProjectObj(hazard.getProjectID()),
issueManager.getIssueObject(hazard.getIssueID())));
}
return Response.ok(hazards).build();
}