This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Versions in Redmine



Overview

The following operations allow you to work with versions. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with versions, see  Sample configuration .

OperationDescription

getVersions

Retrieves all versions.

Operation details

This section provides details on each of the operations.

 Get Versions

The getVersions retrieves all versions of a product.

getVersions
<redmine.getVersions>
	<id>{$ctx:id}</id>
</redmine.getVersions> 
Properties
  • id: Required - Id of the product which you wish to get the versions.
Sample request

Following is a sample REST request that can be handled by the getVersions operation.

Sample Request for getVersions
{
	"apiUrl":"http://sample.m.redmine.org",
	"apiKey":"445006e59d31f392ca7df002da0dcf66626471cfeb",
	"responseType":"json",
	"id":"1"
} 
Related Redmine documentation

http://www.redmine.org/projects/redmine/wiki/Rest_Versions#GET

Sample configuration

Following is a sample proxy service that illustrates how to connect to Redmine with the init operation and use the getVersions operation. The sample request for this proxy can be found in getVersions sample request. You can use this sample as a template for using other operations in this category.

As a best practice,  create a separate sequence for handling the response payload for errors. In the following sample, this sequence is "faultHandlerSeq". For more information, see /wiki/spaces/CONNECTORS/pages/48464453 .

Sample Proxy
<proxy xmlns="http://ws.apache.org/ns/synapse" name="redmine_getVersions" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
  <target>
    <inSequence onError="faultHandlerSeq">
      <property name="apiUrl" expression="json-eval($.apiUrl)"/>
      <property name="apiKey" expression="json-eval($.apiKey)"/>
      <property name="responseType" expression="json-eval($.responseType)"/>
      <property name="id" expression="json-eval($.id)"/>
      <redmine.init>
        <apiUrl>{$ctx:apiUrl}</apiUrl>
        <apiKey>{$ctx:apiKey}</apiKey>
        <responseType>{$ctx:responseType}</responseType>
      </redmine.init>
      <redmine.getVersions>
	    <id>{$ctx:id}</id>
      </redmine.getVersions> 
      <filter source="$axis2:HTTP_SC" regex="^[^2][0-9][0-9]">
            <then>
               <switch source="$axis2:HTTP_SC">
                  <case regex="401">
                     <property name="ERROR_CODE" value="600401"/>           
           			 <property name="ERROR_MESSAGE" value="Authorization failed."/>
                  </case>
                  <case regex="422">
                     <property name="ERROR_CODE" value="600422"/>           
           			 <property name="ERROR_MESSAGE" expression="//errors"/>
                  </case>
                  <case regex="404">
                     <property name="ERROR_CODE" value="600404"/>           
           			 <property name="ERROR_MESSAGE" value="Resource not found."/>
                  </case>
          		  <case regex="403">
                     <property name="ERROR_CODE" value="600403"/>           
           			 <property name="ERROR_MESSAGE" value="Forbidden operation."/>
                  </case>
                  <case regex="400">
                     <property name="ERROR_CODE" value="600400"/>           
           			 <property name="ERROR_MESSAGE" value="Bad request."/>
                  </case>
                  <case regex="500">
                     <property name="ERROR_CODE" value="600500"/>  
          		  	 <property name="ERROR_MESSAGE" value="Internal Server Error."/>
                  </case>
                  <default> 
            		 <property name="ERROR_CODE" expression="$axis2:HTTP_SC"/>
                     <property name="ERROR_MESSAGE" value="An error occurred."/>
                  </default>
               </switch>
               <sequence key="faultHandlerSeq" />
            </then>
         </filter>
      <respond />
    </inSequence>
    <outSequence>
       <send></send>
    </outSequence>
  </target>
</proxy>

 

Â