Class ChangeManagementSystem

java.lang.Object
flexagon.fd.model.integration.cms.api.ChangeManagementSystem

public abstract class ChangeManagementSystem extends Object
Abstract class for FlexDeploy integration with any third-party Change Management System.
  • Change "Tickets" for automated approval of workflow requests or pipeline gates
  • "Incidents" for automated problem identification upon deployment failure

A "Ticket" is a general term for an object in a CMS which is used to govern approval. Tickets can be tied to FlexDeploy approvals (both in pipeline gates and for deployment workflow requests). Whether the underlying CMS terms this type of object a ticket, change, change request or anything else, the API must map the object to a CMSObjectType.TICKET to enable integration with FlexDeploy's CMS framework.

An "Incident" is a general term for an object in a CMS which is used to report a problem. FlexDeploy can be configured to automatically create incidents upon a deployment failure. Whether the underlying CMS terms this type of object an incident, problem, or anything else, the API must map the object to a CMSObjectType.INCIDENT to enable integration with FlexDeploy's CMS framework.

Out of the box implementations for of this API are provided for:

  • ServiceNow
  • Freshservice
  • BMC Helix Remedyforce
  • Field Details

  • Constructor Details

    • ChangeManagementSystem

      public ChangeManagementSystem()
  • Method Details

    • setChangeManagementSystemName

      public void setChangeManagementSystemName(String pChangeManagementSystemName)
      Sets the name of the CMS to be displayed under Change Management Systems
      Parameters:
      pChangeManagementSystemName - String The name of the Change Management System
    • getChangeManagementSystemName

      public String getChangeManagementSystemName()
      Retrieves the name of the change management system
      Returns:
      String The name of the Change Management System
    • setProperties

      public void setProperties(Map<String,Serializable> pProperties)
      Sets the CMS instance properties
      Parameters:
      pProperties - A Map of CMS properties with key of property code and value of String, Boolean, Integer, Float or Double
    • getProperties

      public Map<String,Serializable> getProperties()
      Returns the CMS properties by property code
      Returns:
      Map<String, Serializable> The properties Map
    • getProperty

      protected String getProperty(String pPropertyKey)
      Returns a CMS instance property with given code as a String.
      Parameters:
      pPropertyKey - String The property key
      Returns:
      String The String property value
    • getBooleanProperty

      protected Boolean getBooleanProperty(String pPropertyKey)
      Returns a CMS instance property with the given code as a Boolean
      Parameters:
      pPropertyKey - String The property key
      Returns:
      Boolean The Boolean property value
    • getIntegerProperty

      protected Integer getIntegerProperty(String pPropertyKey)
      Returns a CMS instance property with the given code as an Integer
      Parameters:
      pPropertyKey - String The property key
      Returns:
      Integer the Integer property value
    • getFloatProperty

      protected Float getFloatProperty(String pPropertyKey)
      Returns a CMS instance property with the given code as a Float
      Parameters:
      pPropertyKey - String The property key
      Returns:
      Float the Float property value
    • getDoubleProperty

      protected Double getDoubleProperty(String pPropertyKey)
      Returns a CMS instance property with the given code as a Double
      Parameters:
      pPropertyKey - String The property key
      Returns:
      Double the Double property value
    • createTicket

      public abstract CMSObject createTicket(Map<String,Serializable> pTicketFields) throws ApiException
      Creates a CMS Ticket with the given fields. The concrete implementation much create the object appropriate for the underlying CMS (e.g. change, change request, etc.)
      Parameters:
      pTicketFields - A Map of fields to use when creating the ticket
      Returns:
      CMSObject The CMS Ticket object
      Throws:
      ApiException - Throw if ticket cannot be created in the underlying CMS
    • createIncident

      public abstract CMSObject createIncident(Map<String,Serializable> pIncidentFields) throws ApiException
      Creates a CMS Incident with the given fields. The concrete implementation much create the object appropriate for the underlying CMS (e.g. incident, problem, etc.)
      Parameters:
      pIncidentFields - A Map of fields to use when updating the ticket
      Returns:
      CMSObject The CMS Incident Object
      Throws:
      ApiException - Throw if ticket cannot be updated in the underlying CMS
    • findCMSObjectByType

      public abstract CMSObject findCMSObjectByType(String pCMSObjectNumber, ChangeManagementSystem.CMSObjectType pCMSObjectType) throws ApiException
      Finds and returns a CMS Object (Ticket or Incident) with the given identifier and type.
      Parameters:
      pCMSObjectNumber - The unique identifier of the ticket
      pCMSObjectType - The type of object to find (TICKET or INCIDENT)
      Returns:
      CMSObject The CMS Object matching the criteria
      Throws:
      ApiException - Throw if the object is not found in the underlying CMS
    • findCMSObjectsByType

      public List<CMSObject> findCMSObjectsByType(List<String> pCMSObjectNumbers, ChangeManagementSystem.CMSObjectType pCMSObjectType) throws ApiException
      Finds and returns CMS Objects (Ticket or Incident) with the given identifier and type.
      Parameters:
      pCMSObjectNumbers - The unique identifier of the tickets
      pCMSObjectType - The type of object to find (TICKET or INCIDENT)
      Returns:
      CMSObject The CMS Object matching the criteria
      Throws:
      ApiException - Throw if the object is not found in the underlying CMS
    • findTicketByType

      public CMSObject findTicketByType(String pTicketNumber) throws ApiException
      Finds and returns a CMS Ticket object.
      Parameters:
      pTicketNumber - The unique identifier of the ticket
      Returns:
      CMSObject The CMS Ticket
      Throws:
      ApiException - Thrown if the ticket cannot be found
    • findIncidentByType

      public CMSObject findIncidentByType(String pIncidentNumber) throws ApiException
      Finds and returns a CMS Ticket object.
      Parameters:
      pIncidentNumber - The unique identifier of the incident
      Returns:
      CMSObject The CMS Incident
      Throws:
      ApiException - Thrown if the incident cannot be found
    • isTicketApproved

      public abstract Boolean isTicketApproved(CMSObject pTicket, String pEnvironmentCode)
      Checks if the given CMS Ticket is approved for an environment.
      Parameters:
      pTicket - The CMS Ticket
      pEnvironmentCode - The environment code of the target FlexDeploy environment
      Returns:
      Boolean Whether the CMS Ticket is approved
    • isTicketRejected

      public abstract Boolean isTicketRejected(CMSObject pTicket, String pEnvironmentCode)
      Checks if the given CMS Ticket is rejected for an environment.
      Parameters:
      pTicket - The CMS Ticket
      pEnvironmentCode - The environment code of the target FlexDeploy environment
      Returns:
      Boolean Whether the CMS Ticket is rejected
    • isDoPolling

      public abstract Boolean isDoPolling()
      Returns whether polling is enabled for checking CMS Ticket status. If polling is not enabled, to approve/reject it is assumed that the REST API is utilized to approve or reject the associated task.
      Returns:
      Boolean Whether automated polling for ticket status should be performed
    • checkConnection

      public abstract void checkConnection() throws ApiException
      Check connection using details provided in getProperties(). If a connection can not be established, implementations should throw an ApiException with an appropriate error message.
      Throws:
      ApiException - Throw if connection cannot be established to the underlying CMS
    • getTicketURL

      public String getTicketURL(CMSObject pCMSObject) throws ApiException
      Return ticket's absolute URL. You can use getProperties() details along with ticket object (number, type, description) to determine URL. This is used to display the URL for the change ticket which is linked with deployed projects/packages.
      Parameters:
      pCMSObject -
      Returns:
      url to ticket
      Throws:
      ApiException
    • getAdditionalTicketInfo

      public Map<String,Serializable> getAdditionalTicketInfo(CMSObject pTicket, String pEnvironmentCode, Boolean pIsApproved) throws ApiException
      Returns a map containing information to add to FlexDeploy External Approvals 5.5.0.2 - 'notes' entry is added to notes of External Approval 9.0.0.2 - 'actionon' entry is added to action_on of External Approval 9.0.0.2 - 'actionby' entry is added to action_by of External Approval
      Parameters:
      pTicket - The CMS Ticket
      pEnvironmentCode - The environment code of the target FlexDeploy environment
      pIsApproved - Whether the ticket is approved
      Returns:
      Map<String, Serializable>
      Throws:
      ApiException
    • uploadAttachmentToTicket

      public void uploadAttachmentToTicket(String pTicketNumber, String pFileName, InputStream pAttachment) throws ApiException
      Uploads an attachment to an existing CMS Ticket.
      Parameters:
      pTicketNumber - The CMS Ticket.
      pFileName - The name of the attachment.
      pAttachment - The attachment to be uploaded to the CMS Ticket.
      Throws:
      ApiException - Throw if attachment cannot be uploaded in the CMS Ticket.
    • uploadAttachmentToIncident

      public void uploadAttachmentToIncident(String pIncidentNumber, String pFileName, InputStream pAttachment) throws ApiException
      Uploads an attachment to an existing CMS Incident.
      Parameters:
      pIncidentNumber - The CMS Incident.
      pFileName - The name of the attachment.
      pAttachment - The attachment to be uploaded to the CMS Incident.
      Throws:
      ApiException - Throw if attachment cannot be uploaded in the CMS Incident.
    • addCommentToTicket

      public void addCommentToTicket(String pTicketNumber, String pComment) throws ApiException
      Adds a comment to a change ticket.
      Parameters:
      pTicketNumber -
      pComment -
      Throws:
      ApiException
    • changeTicketStatusTo

      public abstract void changeTicketStatusTo(String pTicketNumber, Serializable pStatus) throws ApiException
      Updates the status of a change ticket
      Parameters:
      pTicketNumber -
      pStatus -
      Throws:
      ApiException