Versions Compared

Key

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

...

Go to Issue Tracking Systems page using Administration Configuration Integrations Issue Tracking menu.

...

Let's look at more details on how to create a custom issue tracking system integration with Flex DeployIssue Tracking System Provider with FlexDeploy. Click Create to implement an integration with custom issue tracking system.

Go to the ITS Providers screen.

...

Click create, or click on an existing row if you are making changes to an existing ITS Provider.

...

  • Provide a unique name and optionally description

  • Define properties for the new issue tracking system. Properties are configuration values used by FlexDeploy to connect to the new system. The values of the properties that you define here are set on Issue Tracking Instances, folders, and projects.

    • If you define properties, you can indicate display and validation details. You can also indicate if a property is required and/or encrypted.

    • Enter a unique Name before adding any properties

  • Provide either Java Implementation or Groovy API.

  • Click Save.

...

  • If both are supplied, the Java Implementation is used. Java implementation means that you are giving the classpath for a java class which you are placing the jar for in the libext folder. Groovy is defined on the Groovy Api tab. A Groovy script would allow for dynamic update, whereas use of Java code will require restart of server.

  • Click Save.

Here we are creating editing a custom issue tracking system with properties. You can add more as necessary.

...

You can add existing properties using the drop down on the create button.

...

API Implementation

  •  Complete this section.

Your Implementation must implement include the following API operations to integrate with FlexDeploymethods in order to be used by FlexDeploy. If you are not going to allow updating tickets, you can leave the body blank, or throw an error in the body, but the method must be defined.

Method Name

Parameter(s)

Return Type

Description

populateTicket

Ticket pTicket

void

This method should call the issue Tracking System using the ticket number (pTicket.getNumber()) and set the Description and Type

getTicketURL

Ticket pTicket

String

This method should construct the URL to access the ticket, which is used to link from FlexDeploy. (Ex. http://<hostname>:<port>/redmine/issues/<issuenumber>.json)

addCommentToTicket

Ticket pTicket,

String pComment

void

Adding pComment to the ticket. The ticket number (pTicket.getNumber()) from Ticket object should be used to get the Ticket and add the comment.

changeTicketStatusTo

Ticket pTicket,

String pStatus

void

Change the status of the ticket to pStatus. The ticket number (pTicket.getNumber()) from Ticket object should be used to get the Ticket and change the status. The status passed into the function is the status id.

getTicketStatus

Ticket pTicket

String

Get the current status of the ticket. The ticket number (pTicket.getNumber()) from Ticket object should be used to get the Ticket status.

checkConnection


void

This should invoke any status or heath check URL of the issue tracking system to ensure the system is up and running and FlexDeploy can connect with the provided credentials

parseTicketNumberFromChangeLogs

String pProjectName,

List<String> pMessagesToParse,

List<String> pTicketPatternList

Collection<String>

pProjectName - name of the project for which the Issue tracking system is configured

pMessageToParse - list of string from the SCM commit logs

pTicketPatternList  - pattern configured in the project or for the issues tracking system.

Add a custom rule by project to parse the message log string using single or multiple patterns. You can also use a different pattern list. Should return a unique list of ticket numbers

...

  • In order to compile your java class, you will need FlexDeployAPI.jar on classpath.

  • Implement all the methods described in the table in the API Implementation section.

  • For any failure connecting to the system or if any issues with the data, then you can throw exception. For example throw new ApiException("Invalid credentials.", "");

  • Once you are ready with unit testing, you can prepare Jar file for your credential store java class and other utility classes. This jar file can be placed on server classpath now.

    • Put this jar file in apache-tomcat-flexdeploy/libext folder.

    • If you are using any third party libraries from your Java implementation, then those jar files will also need to be added to same libext folder.

  •  Update this jar file

Groovy Implementation

Here are the high level steps for a Groovy implementation. You can use any IDE to prepare this implementation. 

...