Uploaded image for project: 'Compass'
  1. Compass
  2. COMPASS-143

Updating scorecard criteria descriptions via GraphQL API returns "The criteria description parameter is invalid" error

XMLWordPrintable

      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.

      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.

              Unassigned Unassigned
              941c832d1c72 Alie Sesay (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: