Class ChangeManagementSystem
- 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCMS Object Type Any object which is used to govern approval must be set as TICKET. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommentToTicket(String pTicketNumber, String pComment) Adds a comment to a change ticket.abstract voidchangeTicketStatusTo(String pTicketNumber, Serializable pStatus) Updates the status of a change ticketabstract voidCheck connection using details provided in getProperties().abstract CMSObjectcreateIncident(Map<String, Serializable> pIncidentFields) Creates a CMS Incident with the given fields.abstract CMSObjectcreateTicket(Map<String, Serializable> pTicketFields) Creates a CMS Ticket with the given fields.abstract CMSObjectfindCMSObjectByType(String pCMSObjectNumber, ChangeManagementSystem.CMSObjectType pCMSObjectType) Finds and returns a CMS Object (Ticket or Incident) with the given identifier and type.findCMSObjectsByType(List<String> pCMSObjectNumbers, ChangeManagementSystem.CMSObjectType pCMSObjectType) Finds and returns CMS Objects (Ticket or Incident) with the given identifier and type.findIncidentByType(String pIncidentNumber) Finds and returns a CMS Ticket object.findTicketByType(String pTicketNumber) Finds and returns a CMS Ticket object.getAdditionalTicketInfo(CMSObject pTicket, String pEnvironmentCode, Boolean pIsApproved) 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 Approvalprotected BooleangetBooleanProperty(String pPropertyKey) Returns a CMS instance property with the given code as a BooleanRetrieves the name of the change management systemprotected DoublegetDoubleProperty(String pPropertyKey) Returns a CMS instance property with the given code as a Doubleprotected FloatgetFloatProperty(String pPropertyKey) Returns a CMS instance property with the given code as a Floatprotected IntegergetIntegerProperty(String pPropertyKey) Returns a CMS instance property with the given code as an IntegerReturns the CMS properties by property codeprotected StringgetProperty(String pPropertyKey) Returns a CMS instance property with given code as a String.getTicketURL(CMSObject pCMSObject) Return ticket's absolute URL.abstract BooleanReturns whether polling is enabled for checking CMS Ticket status.abstract BooleanisTicketApproved(CMSObject pTicket, String pEnvironmentCode) Checks if the given CMS Ticket is approved for an environment.abstract BooleanisTicketRejected(CMSObject pTicket, String pEnvironmentCode) Checks if the given CMS Ticket is rejected for an environment.voidsetChangeManagementSystemName(String pChangeManagementSystemName) Sets the name of the CMS to be displayed under Change Management SystemsvoidsetProperties(Map<String, Serializable> pProperties) Sets the CMS instance propertiesvoiduploadAttachmentToIncident(String pIncidentNumber, String pFileName, InputStream pAttachment) Uploads an attachment to an existing CMS Incident.voiduploadAttachmentToTicket(String pTicketNumber, String pFileName, InputStream pAttachment) Uploads an attachment to an existing CMS Ticket.
-
Field Details
-
mProperties
-
-
Constructor Details
-
ChangeManagementSystem
public ChangeManagementSystem()
-
-
Method Details
-
setChangeManagementSystemName
Sets the name of the CMS to be displayed under Change Management Systems- Parameters:
pChangeManagementSystemName- String The name of the Change Management System
-
getChangeManagementSystemName
Retrieves the name of the change management system- Returns:
- String The name of the Change Management System
-
setProperties
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
Returns the CMS properties by property code- Returns:
- Map<String, Serializable> The properties Map
-
getProperty
Returns a CMS instance property with given code as a String.- Parameters:
pPropertyKey- String The property key- Returns:
- String The String property value
-
getBooleanProperty
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
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
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
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
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 ApiExceptionCreates 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 ticketpCMSObjectType- 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 ticketspCMSObjectType- 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
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
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
Checks if the given CMS Ticket is approved for an environment.- Parameters:
pTicket- The CMS TicketpEnvironmentCode- The environment code of the target FlexDeploy environment- Returns:
- Boolean Whether the CMS Ticket is approved
-
isTicketRejected
Checks if the given CMS Ticket is rejected for an environment.- Parameters:
pTicket- The CMS TicketpEnvironmentCode- The environment code of the target FlexDeploy environment- Returns:
- Boolean Whether the CMS Ticket is rejected
-
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 ApiExceptionCheck 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
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 TicketpEnvironmentCode- The environment code of the target FlexDeploy environmentpIsApproved- 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
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
-