'Value for scoreCard is invalid' seen while updating a Jira Align Program using the API

Still need help?

The Atlassian Community is here for you.

Ask the community

Summary

When updating the Program Name via a PATCH API call, the error “Cannot update program with id ###. Value for scoreCard is invalid” is returned.

As can be seen on the screenshot (using the Postman API client) below:

       



Environment

  Jira Align 

Diagnosis

Checking the Audit LOG for the affected Program, we can see an entry like the one below, that points to when it was created and the ScoreCard it used:

Score Card: Use {12_S} Score Card

Where “{12_S} Score Card” is the Portfolio Score Card.

Checking the Scorecard Configuration, there is no “{12_S} Score Card” (neither Portfolio Score Card) in the Edit Scorecard dropdown menu.

Checking back the Audit LOG, there is another entry showing the Score Card changed from "NULL" to "Default Scorecard"

Score Card Changed - From [ ] To [ Default ScoreCard ]

It's an "automatic internal" change as, at this moment, the “{12_S} Score Card” doesn't exist anymore.

Despite this apparent change in the Audit LOG, internally the Score Card value keeps "NULL".

Cause

The issue is presented if a Score Card is deleted while is still in use by a Program.

Solution

There are two ways to avoid the issue of updating a Program via API Call:

Option 1:

  1. Save the Program via UI, to update the "Score Card value" properly.

  2. After that, you are able to update the Program, including the Score Card value, via API Calls with no errors.

Option 2:

Via API, use a PUT Call instead of a PATCH Call.

      1. Identify the proper value of ScoreCardId.

         To do it, a GET Call can be used to get the value of ScoredCardId of a Program tied to the affected Program. A call, similar to the below one, can be used:

https://[MyInstance].jiraalign.com/rest/align/api/2/Programs/[ProgramID]

      2. Set the ScoredCardId value, identified in Step 1, using a PUT Call.
          A payload, similar to the below one, can be used:

{
  "title": "Program with deleted ScoreCard",
  "portfolioId": 165,
  "solutionId": null,
  "isSolution": null,
  "teamId": 6870,
  "teamDescription": "Program with deleted ScoreCard - Updated via API",
  "scoreCardId": 1,
  "intakeFormId": 0,
  "regionId": null,
  "caseDevelopmentId": null
}


Related Content:

Getting started with the REST API 2.0



Last modified on Feb 15, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.