Rally: Custom integrations return errors or fail to update work items

book

Article ID: 199512

calendar_today

Updated On:

Products

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

Issue/Introduction

When integrating with the Rally API, sometimes the integration will throw unexpected errors, or you'll find that an update does not occur even though you received a 200 HTTP response back.
When using Java, for example, a java.lang.NullPointerException is seen and the execution of the application is ended.
 

Cause

This is caused by when the API returns an unexpected condition to the integration.

Resolution

It is best practice to examine the HTTP response code for non-200 responses and including some logic to deal with that situation.

Additionally it is best practice to examine the Error object of the JSON response even if a 200 HTTP response is received.

A Rally WSAPI JSON response will always include an Error object as highlighted below and if the API encounters a problem with fulfilling the request, it will populate that object with an error

{
 "OperationResult":{
  "_rallyAPIMajor": "2",
  "_rallyAPIMinor": "0",
  "Errors":[
   "Could not read: Could not read Defect 2037775838845 to update."
  ],
  "Warnings":[]
 }
}

 

Additional Information

Keywords: Agile Central Webservices WS-API WSAPI