How To create a custom field using WSAPI
search cancel

How To create a custom field using WSAPI

book

Article ID: 75112

calendar_today

Updated On:

Products

CA Agile Central On Premise (Rally) CA Agile Central SaaS (Rally)

Issue/Introduction

In this doc we shall use WSAPI to create a custom field named: "c_SagiMyTestExample_1". We will associate it with the Defect artifact and confirm it's fully functional.

Resolution

A field is represented by the AttributeDefinition endpoint in Rally WSAPI Rest API.

This endpoint has 3 required fields that must be provided to create the custom field: Name, RealAttributeType and TypeDefinition.
You can view the full definition of this endpoint at: https://rally1.rallydev.com/slm/doc/webservice/ (click the AttributeDefinition object listed in the left page under Object Model).

Below we demonstrate creating the custom field using PostMan to get/post REST calls. Any similar tool (such as SOAP UI) can be similarly used.

REST Request
Here is the call to create the custom field:

The JSON structure includes our three required properties:

Name - The name of our custom field.

RealAttributeType - Resolves how this field will behave in Rally. Our example uses "STRING".  Here is the list of accepted types for RealAttributeType. You will find this list in the online WSAPI doc for AttributeDefinition (scroll down to locate the RealAttributeType):

TypeDefinition - Holds the structure of the Type Definition matching the artifact to associate our new custom field with. In this example that would be the Type Definition for Defect. You will need to separately query the TypeDefinition object to retrieve that structure.

REST Response
The REST response will have the details of the newly created custom field:

Refresh the WSAPI online doc. This will now include the new custom field. Under the Defect artifact, we can see:

You can also check in Rally. Go to your project settings -> fields -> select the artifact (in our case: Defect):


To confirm the field is usable, create a new Defect, scroll down to the Custom section: