Update organization ownership for existing queries

Persistent queries refers to triggers and shared dashboards. You can update multiple existing persistent queries to organization ownership using the batchUpdateQueryOwnership() GraphQL mutation. This mutation supports different levels of granularity for batch updates:

  • All persistent queries under list of views and repositories.

  • A concrete list of persistent queries.

  • All persistent queries under the entire organization.

Navigate to the Accessing GraphQL using API Explorer or use an API client such as cURL or Postman to run the batch update.

GraphQL mutation example.  To convert all persistent queries within your organization to organization-owned queries, execute the following GraphQL mutation:

graphql
mutation {
  batchUpdateQueryOwnership(input: { targetType: Organization, ids: [] })
}

The targetType can be View, PersistentQuery or Organization, as noted above.

The ids parameter is an optional argument that lists the ID of each asset for which query ownership should be modified. For instance, you can select the PersistentQuery type and provide a set of alert IDs to update only those queries, rather than updating all queries in the organization.