Rally Software

  • 1.  Using the Rally REST API to fetch a Field Dictionary

    Posted Nov 15, 2017 04:29 PM

    Using the Rally REST API, I am trying to find the correct endpoint(s) for fetching a list of available Fields for a ticket. For example: How would I fetch a list of Fields for “hierarchicalrequirement” or “portfolioitem/l2roadmapitem”. Was not able to find an answer in the docs or Forums so far. We are using the REST API direct using Curl commands.

    Thanks

    -Mike



  • 2.  Re: Using the Rally REST API to fetch a Field Dictionary

    Broadcom Employee
    Posted Nov 16, 2017 03:27 AM

    Hi Mike mnewman.1

     

    I think you are looking for Schema Endpoint (https://rally1.rallydev.com/slm/doc/webservice/schema.jsp )which could return a JSON representation of all enabled type definitions and their metadata (such as attributes, allowed values, types, etc.). You just need to get the right objectID for your workspace/project.

     

    Just in case, please find below article to find your object ID. For Developers | CA Agile Central Help 

     

    Kun



  • 3.  Re: Using the Rally REST API to fetch a Field Dictionary

    Posted Nov 16, 2017 08:37 AM

    Hi Kun,

    I already explored that endpoint and its not what I am looking for. When I fetch a ticket, for example a User Story, using “fetch=true” to expand all the fields, I am getting back way more fields than defined from the endpoint you suggested. No custom Fields either “c_*”. Is there a way to do this without making multiple REST API calls?

     

    We need this in order to build out a mapping between Rally and Jira.

    In Jira, I need only call “https:///rest/api/2/field” and I get everything including Field type, Display name, and Element Name.

     

    Thanks

    Mike



  • 4.  Re: Using the Rally REST API to fetch a Field Dictionary

    Posted Nov 16, 2017 09:09 AM

    corkr03 or morky01,

     

    Is there anything like Mike posted above or is the Schema Endpoint the way to go?


    Thanks!

     

    Michael



  • 5.  Re: Using the Rally REST API to fetch a Field Dictionary

    Posted Nov 16, 2017 11:08 AM

    Schema endpoint should be the way to go.  It includes all the available types- user story, defect, etc. and all of the attributes on each.  mnewman.1 can you be more specific about why this didn't work for your use case?

     

    Kyle



  • 6.  Re: Using the Rally REST API to fetch a Field Dictionary

    Posted Nov 16, 2017 12:00 PM

    Kyle,

     

    Sure. The JSON query results returned to me when calling “https://rally1.rallydev.com/slm/webservice/v2.0/Workspace/< ID>/TypeDefinitions”

    Returns about 18 Fields (TypeDefs).  Then I need to iterate through all the types and determine if there is an “attributes” ref. If there is, then another REST call for each of those. If this is the only way to programmatically discover all possible ticket Fields, then fine, but I am not seeing any of the “c_*”  fields when taking this approach.

     

    It seems the only way for me to get a full list of fields, is to just query a ticket (formattedId=”USxxxxxx”) and just iterate the fields. But that approach only gives me the Element Names.

     

    Would be nice to be able to get this with one REST Call.

     

    Thanks

    Mike



  • 7.  Re: Using the Rally REST API to fetch a Field Dictionary
    Best Answer

    Posted Nov 16, 2017 01:58 PM

    Kyle,

     

    I discovered the problem. The my REST API call was not correctly passing the pagesize query parameter and therefore chopping off my results set.

     

    I had to change this:

    ?pagesize=200

     

    to this:

    ?&pagesize=200

     

    Note the need for an additional ‘&’ after the ‘?’ query string delimiter.

     

    Now I can iterate through all the typedefs and attributes.

     

    Thanks

    -Mike