use of org.opennms.integration.remedy.ticketservice.SetInputMap in project opennms by OpenNMS.
the class RemedyTicketerPlugin method update.
private void update(Ticket ticket) throws PluginException {
HPD_IncidentInterface_WSPortTypePortType port = getTicketServicePort(m_portname, m_endpoint);
if (port != null) {
try {
GetOutputMap remedy = port.helpDesk_Query_Service(getRemedyInputMap(ticket.getId()), getRemedyAuthenticationHeader());
if (remedy == null) {
LOG.info("update: Remedy: Cannot find incident with incindent_number: {}", ticket.getId());
return;
}
if (remedy.getStatus().getValue().equals(StatusType._value7)) {
LOG.info("update: Remedy: Ticket Cancelled. Not updating ticket with incindent_number: {}", ticket.getId());
return;
}
if (remedy.getStatus().getValue().equals(StatusType._value6)) {
LOG.info("update: Remedy: Ticket Closed. Not updating ticket with incindent_number: {}", ticket.getId());
return;
}
SetInputMap output = getRemedySetInputMap(ticket, remedy);
// The only things to update are urgency and state
LOG.debug("update: Remedy: found urgency: {} - for ticket with incindent_number: {}", output.getUrgency().getValue(), ticket.getId());
output.setUrgency(getUrgency(ticket));
LOG.debug("update: opennms status: {} - for ticket with incindent_number: {}", ticket.getState(), ticket.getId());
LOG.debug("update: Remedy: found status: {} - for ticket with incindent_number: {}", output.getStatus().getValue(), ticket.getId());
State outputState = remedyToOpenNMSState(output.getStatus());
LOG.debug("update: Remedy: found opennms status: {} - for ticket with incindent_number: {}", outputState, ticket.getId());
if (!(ticket.getState() == outputState))
output = opennmsToRemedyState(output, ticket.getState());
port.helpDesk_Modify_Service(output, getRemedyAuthenticationHeader());
} catch (RemoteException e) {
e.printStackTrace();
throw new PluginException("Problem creating ticket", e);
}
}
}
use of org.opennms.integration.remedy.ticketservice.SetInputMap in project opennms by OpenNMS.
the class RemedyTicketerPlugin method getRemedySetInputMap.
private SetInputMap getRemedySetInputMap(Ticket ticket, GetOutputMap output) {
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
return new SetInputMap(output.getCategorization_Tier_1(), output.getCategorization_Tier_2(), output.getCategorization_Tier_3(), output.getClosure_Manufacturer(), output.getClosure_Product_Category_Tier1(), output.getClosure_Product_Category_Tier2(), output.getClosure_Product_Category_Tier3(), output.getClosure_Product_Model_Version(), output.getClosure_Product_Name(), output.getCompany(), output.getSummary(), output.getNotes(), output.getImpact(), output.getManufacturer(), output.getProduct_Categorization_Tier_1(), output.getProduct_Categorization_Tier_2(), output.getProduct_Categorization_Tier_3(), output.getProduct_Model_Version(), output.getProduct_Name(), output.getReported_Source(), output.getResolution(), output.getResolution_Category(), output.getResolution_Category_Tier_2(), output.getResolution_Category_Tier_3(), "", output.getService_Type(), output.getStatus(), output.getUrgency(), ACTION_MODIFY, "", "", Work_Info_TypeType.value10, cal, Work_Info_SourceType.value1, VIPType.No, Work_Info_View_AccessType.Public, ticket.getId(), output.getStatus_Reason(), output.getServiceCI(), output.getServiceCI_ReconID(), output.getHPD_CI(), output.getHPD_CI_ReconID(), output.getHPD_CI_FormName(), output.getZ1D_CI_FormName(), "", new byte[0], 0);
}
Aggregations