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 Custom Fields in Redmine



Overview

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

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

OperationDescription

getCustomFields

Gets details of custom fields.

Operation details

This section provides details on each of the operations.

Gets details of custom fields.

The getCustomFields operation gets details of custom fields..

getCustomFields
<redmine.getCustomFields>
</redmine.getCustomFields>
Sample request

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

Sample Request for getCustomFields
{
  "apiUrl": "%s(apiUrl)",
  "apiKey": "%s(apiKey)",
  "responseType": "json"
}
Related Redmine documentation

http://www.redmine.org/projects/redmine/wiki/Rest_CustomFields

Sample configuration

Following is a sample proxy service that illustrates how to connect to Redmine with the init operation and use the getCustomFields operation. The sample request for this proxy can be found in getCustomFields 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.

getCustomFields
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" 
	name="redmine_getCustomFields" 
	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)"/>
 <redmine.init>
        <apiUrl>{$ctx:apiUrl}</apiUrl>           
        <apiKey>{$ctx:apiKey}</apiKey>           
        <responseType>{$ctx:responseType}</responseType>
      </redmine.init>	 	  
    <redmine.getCustomFields>
	</redmine.getCustomFields>
		 <property name="messageType" value="application/json" scope="axis2"/>
         <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" expression="json-eval($.Error.Code)"/>
                     <property name="error_description" expression="json-eval($.Error.Message)"/>
                  </case>
                  <case regex="404">
                     <property name="ERROR_CODE" value="600404"/>					  
					 <property name="ERROR_MESSAGE" expression="json-eval($.Error.Code)"/>
                     <property name="error_description" expression="json-eval($.Error.Message)"/>
                  </case>
				  <case regex="403">
                     <property name="ERROR_CODE" value="600403"/>					  
					 <property name="ERROR_MESSAGE" expression="json-eval($.Error.Code)"/>
                     <property name="error_description" expression="json-eval($.Error.Message)"/>
                  </case>
                  <case regex="422">
                     <property name="ERROR_CODE" value="600422"/>
                     <property name="ERROR_MESSAGE" expression="json-eval($.Error.Code)"/>
                     <property name="error_description" value="Unprocessable Entity"/>
                  </case>				  
                  <case regex="400">
                     <property name="ERROR_CODE" value="600400"/>					  
					 <property name="ERROR_MESSAGE" expression="json-eval($.Error.Code)"/>
                     <property name="error_description" expression="json-eval($.Error.Message)"/>
                  </case>
                  <case regex="500">
                     <property name="ERROR_CODE" value="600500"/>  
					 <property name="ERROR_MESSAGE" expression="json-eval($.Error.Code)"/>
                     <property name="error_description" expression="json-eval($.Error.Message)"/>
                  </case>
                  <default> 
				     <property name="ERROR_CODE" expression="$axis2:HTTP_SC"/>
                     <property name="ERROR_MESSAGE" expression="json-eval($.Error.Code)"/>
                     <property name="error_description" expression="json-eval($.Error.Message)"/>
                  </default>
               </switch>
			<sequence key="faultHandlerSeq" />
            </then>
         </filter>
         <respond/>
      </inSequence>
      <outSequence>
	     <send/>
      </outSequence>
   </target>
   <description/>
</proxy>