Bulk edit dashboard API returns an error message if there's already an existing permissions in the dashboard

XMLWordPrintable

    • 3
    • Minor
    • 28

      Issue Summary

      We encounter this regularly during customer migrations: Our app attempts to grant itself edit permissions to add migrated gadgets to the migrated dashboards. In some fraction of requests, we receive an error message that does not seem valid.

      • This generally happens during DC to cloud migrations
      • This fails consistently for specific users

      Steps to Reproduce

      1. HTTP PUT /rest/api/3/dashboard/bulk/edit - run this api with the addpermission action.

       

      [{
          "action": "addPermission",
          "entityIds": [ 10001 ],
          "extendAdminPermissions": true,
          "permissionDetails": {
              "editPermissions": [
                  {
                      "type": "user",
                      "user": {
                          "accountId": "..."
                      }
                  }
              ],
              "sharePermissions": []
          }
      }] 

       

       2. The result we received from Jira contained the error message Invalid type given. Should be one of [USER, PROJECT, GROUP, PROJECT_ROLE, GLOBAL, AUTHENTICATED] for that dashboard.

      Expected Results

      Permission should be added for the user.

      Actual Results

      The below exception is thrown

      Invalid type given. Should be one of [USER, PROJECT, GROUP, PROJECT_ROLE, GLOBAL, AUTHENTICATED] 

      Workaround

      Potential workaround

      1. Use the "Update dashboard" API instead. The tradeoff is, this is not a bulk operation: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-dashboards/#api-rest-api-3-dashboard-id-put

       

              Assignee:
              Unassigned
              Reporter:
              Garvit Dixit
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: