-
Bug
-
Resolution: Not a bug
-
Low
-
None
-
1
-
Severity 3 - Minor
-
Issue Summary
Using the Compass GraphQL API updateScorecard mutation to update or create a scorecard fails with the error "The criteria description parameter is invalid", even though the description parameter is documented and provided as per the API reference.
- Ref: https://developer.atlassian.com/cloud/compass/graphql/#mutations_updateScorecard
Steps to Reproduce
Use the following GraphQL mutation and variables to update a scorecard:
mutation updateScorecard($scorecardId: ID!, $input: UpdateCompassScorecardInput!) { compass { updateScorecard(scorecardId: $scorecardId, input: $input) { success scorecardDetails { id name description scoringStrategyType @optIn(to: "compass-beta") componentTypeIds criterias { id name weight ... on CompassHasMetricValueScorecardCriteria { metricDefinitionId comparator comparatorValue description @optIn(to: "compass-beta") automaticallyCreateMetricSources } } } errors { message } } } }
Variables
{ "scorecardId": "scorecard-id", "input": { "name": "testing something new", "description": "something", "importance": "REQUIRED", "state": "PUBLISHED", "componentTypeIds": [ "CLOUD_RESOURCE" ], "scoringStrategyType": "WEIGHT_BASED", "isDeactivationEnabled": false, "ownerId": "scorecard_owner_id", "updateCriteria": [ { "hasMetricValue": { "weight": 40, "name": "Average", "description": "Something_nice", "id": "criterion-id", "metricDefinitionId": "ari:cloud:compass::metric-definition/builtin/build-success-rate", "comparator": "GREATER_THAN_OR_EQUAL_TO", "comparatorValue": 85 } }, { "hasMetricValue": { "weight": 40, "name": "AccessControl", "description": "testing Something_nice", "id": "criterion-id", "metricDefinitionId": "ari:cloud:compass::metric-definition/builtin/availability-28d", "comparator": "GREATER_THAN_OR_EQUAL_TO", "comparatorValue": 80 } }, { "hasMetricValue": { "weight": 20, "name": "MonitoringCompliance", "description": "bla bla bla", "id": "criterion-id", "metricDefinitionId": "ari:cloud:compass::metric-definition/builtin/critical-alert-count-28d", "comparator": "GREATER_THAN_OR_EQUAL_TO", "comparatorValue": 70 } } ] } }
Expected Results
The scorecard metric criterion descriptions should be updated as specified in the mutation input.
Actual Results
The API returns the following error for each criterion:
"The criteria description parameter is invalid"
Workaround
Update the scorecard metric criterion description from the Compass UI, which works as expected.