Versions Compared

Key

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

...

Groovy Utilities

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.

...

a number of functions available for use in your custom groovy implementation scripts. View suggestions while editing in the script editing windows by typing Ctrl + Space.

Class

Description

LOG

Functions for printing log messages to fd logs

REST

Functions for making REST API calls

Code Block
languagegroovy
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
def client = REST.getClient().url(REDMINE_URL,  + resourcePath);
client.basicauth(REDMINE_USER_NMAENAME, REDMINE_PASSWORD, resourcePath, payload);
client.put(payload);

LOG.info("Rest API create call successful");