Uploaded image for project: 'Jira Align'
  1. Jira Align
  2. JIRAALIGN-8225

Performing a GET Request on Objectives endpoint with 'epicIds' parameter results in Internal Error 500 when no epics are associated

XMLWordPrintable

      Issue Summary

      When using the Jira Align REST API on the Objectives endpoint, the epicIds property is missing entirely from the response body if no Epics are associated with the Objective. This inconsistency becomes problematic when performing a GET request with epicIds as a Select parameter, resulting in a 500 Internal Server Error.

      In contrast, other properties, such as featureIds and impedimentIds are included in the response body as empty arrays when they have no associated data, which is the expected behavior.

      Steps to Reproduce

      1. Use the Jira Align REST API and target the Objectives endpoint.
      2. Ensure you have an Objective that does not have any associated Epics.
      3. Construct a GET request to the Objectives endpoint, including the epicIds field in the Select parameters:
        GET /rest/align/api/2.0/Objectives?select=epicIds
        

      Expected Results

      The epicIds property should be included in the response body of the Objectives endpoint as an empty array ([]) when no Epics are associated with the Objective. This behavior would be consistent with other properties like featureIds and impedimentIds.

      Actual Results

      When no Epics are associated with the Objective, the epicIds property is entirely absent from the response body of the Objectives endpoint.

      Including epicIds as a Select parameter in a GET request causes the API to throw an Internal Server Error 500

      This inconsistent behavior creates challenges for users and applications relying on the API for data consistency and stability.

      Workaround

      • Error Handling: Users must implement additional handling for GET requests to detect and manage cases where the epicIds property is missing altogether.
      • Data Validation: Applications must add logic to validate the response body and insert a default empty array ([]) for epicIds if missing.
      • Avoid Using 'epicIds': Users may choose to avoid including epicIds in the Select parameters to prevent the 500 error, though this limits the functionality of the API.

      By addressing this bug, the API will provide a consistent and logical response for all properties, significantly reducing the need for complex workarounds and the risk of application errors.

              9cd547254f0d Vishnuvardhan Vaidhyanathan (Inactive)
              238f0a5fa446 Rodrigo San Vicente
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: