How To create a custom field using WSAPI

book

Article ID: 75112

calendar_today

Updated On:

Products

CA OPS/MVS Event Management & Automation 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.

Environment

Release:
Component: ACINTG

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:


 

Attachments

1558693972661000075112_sktwi1f5rjvs16mel.png get_app
1558693970686000075112_sktwi1f5rjvs16mek.png get_app
1558693968971000075112_sktwi1f5rjvs16mej.png get_app
1558693967045000075112_sktwi1f5rjvs16mei.png get_app
1558693965117000075112_sktwi1f5rjvs16meh.png get_app
1558693963196000075112_sktwi1f5rjvs16meg.png get_app