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

Creating a KeyResult via API POST call results in error 400: Value for parentType is invalid


    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 10.127.0
    • 10.123.3, 10.124.0
    • REST API
    • 1
    • Severity 3 - Minor
    • No

      Issue Summary

      When a user with a non-super admin role is trying to create a KeyResult via API POST, the error 400: "Cannot create Key Result. Value for parentType is invalid" is thrown.

      Steps to Reproduce

      1. Create (or use existing) non-super user role that has every permission enabled
      2. Assign the user the role created/chosen in step 1
      3. Generate and/or copy the user's API 2.0 token
      4. Login to Jira Align with that user
      5. Create a Portfolio Objective: 'MyObjective' and note the id (e.g. 3627)
      6. Add to 'MyObjective' a key result (for example one of type score)
      7. Use the API token to make a GET call to the objectives/milestones endpoint to retrieve the objective created in step 5.
      8. Use the id (e.g. 3627) of the objective as the parentId in the key result of the POST body request made to the keyresults endpoint.
        For example:
            "parentId": 3627,
            "parentType": 44,
            "baselineValue": 1,
            "targetValue": 2,
            "type": 2,
            "description": "test score key result",
            "weight": 20,
            "createDate": "2023-09-04T07:34:53Z",
            "ownerId": "661802",
            "score": null,
            "isScoreOveridden": null,
            "scoreOverrides": [],
            "valueUpdates": [],
            "targetDate": "2023-09-26T00:00:00Z"

      Expected Results

      The KeyResult is created by the POST request as it can be created in the UI using the same user.
      We should be able to do the same operation via API as in the UI.

      Actual Results

      "Cannot create Key Result. Value for parentType is invalid."


      It is possible to make the request using an API Token from a user with a 'Super Admin' role (roleId:9) assigned.  That is currently the only known workaround at the moment.

            fea1a6ef3355 Yannick Genin
            646db21d89d1 Francois Panaget
            1 Vote for this issue
            3 Start watching this issue