Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Method Name

Return Type



Map<String,Serializable> pTicketFieldsvoid

Creates a Change Request ticket using the pDescription and pComment


Map<String,Serializable> pTicketFieldsString

Creates an Incident ticket using the pDescription and pComment


String pCMSObjectNumber

ChangeManagementSystem.CMSObjectType pCMSObjectType


Find a "ticket" or "incident" using the object identifier and type. The object type will be TICKET or INCIDENT, and implementations must translate that into the corresponding object type within the provider (e.g. Problem, Request, etc.) 


CMSObject pTicket

String pEnvironmentCode

BooleanReturns whether the ticket is approved in the CMS. 

CMSObject pTicket

String pEnvironmentCode

BooleanReturns whether the ticket is rejected in the CMS.



This method should invoke any status or heath check URL of the change management system to ensure the system is up and running and a connection can be authenticated.  This method will be called when the Test Connection button is clicked on the CMS Instance.




Returns whether FlexDeploy should automatically poll the CMS to identify whether the ticket is approved or rejected.  If polling is enabled FlexDeploy will lookup the ticket every 1 minute using findCMSObjectByType and then check the status using the isTicketApproved and isTicketRejected methods.

If polling is not enabled, the CMS or another external system is responsible for approving/rejecting the associated task using the FlexDeploy REST API.

getTicketURLCMSObject pCMSObjectStringreturns the REST API url of the change ticket


If your usage of the CMS will not include the automated creation of TICKET or INCIDENT objects the API can be simplified.  Although createTicket and createIncident are required to be implemented, if you are not using these auto-creation features you can choose to simply throw an exception from one or both methods as appropriate.

Code Block
throw new UnsupportedOperationException("createIncident is not supported for Zendesk CMS integration");

titleAdd custom task notes

With out-of-the-box CMS providers including BMCHelixRemedyforce, ServiceNow, JiraITSM, and Freshworks, you have the ability to add notes to a FlexDeploy External Approval upon approval or rejection. Custom Change Management Systems have the same functionality. Can do so by overriding the following getAdditionalTicketInfo in your Groovy API. It takes CMSObject and environment code as parameters and must return a Map<String, String>.

Code Block
titleSimple Example
def getAdditionalTicketInfo(CMSObject pTicket, String pEnvironmentCode)
  // Create notes to add to External Approval
  def changeNumber = pTicket.getNumber()
  def map = {'notes': 'Approval note for ' changeNumber + ' added by FD admin'}
  return map


There are some utility variables provided by FlexDeploy that can be used in your custom Groovy code.

  • log is a FlexDeploy logger variable which should be used to log any information from the groovy class.
  • fdrestutils is a utility object available to use FlexDeploy API to invoke any REST API.
  • testConnection(String pHostName, String pUrl, String pUserName, String pPassword)
  • getRequest(String pHostName, String pResourcePath, String pUserName, String pPassword) - Returns javax.json.JsonObject
  • postRequest(String pHostName, String pUserName, String pPassword, String pResourcePath, String pResourceName, String pPayload) - Returns boolean
  • putRequest(String pHostName, String pUserName, String pPassword, String pResourcePath, String pPayload) - Returns boolean See the Java docs for more details on the functions available.

    Code Block
    def builder = new groovy.json.JsonBuilder()
    def root = builder.issue
        notes "${pComment}"
    String payload = builder.toString();
    String ticketNumber = ticket.getNumber();
    String resourcePath = REDMINE_TICKET_REST_PATTERN.replaceAll("\\{REDMINE_ISSUE\\}", ticketNumber)
    fdrestutils.putRequest(REDMINE_URL, REDMINE_USER_NMAE, REDMINE_PASSWORD, resourcePath, payload);