Versions Compared

Key

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

...

  • log is a FlexDeploy logger variable which should be used to log any information from the groovy class.
  • itsstatusmap is a map<id, name> which can be used for getting the ITS status names from status ids. This can be useful for getting and updating ticket statuses if the API for your custom issue tracking system uses status names only.
  • 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
    languagegroovy
    themeRDark
    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)
    ;