Skip to content

Commit

Permalink
substitute variables in query
Browse files Browse the repository at this point in the history
  • Loading branch information
maikberthelsen committed Jun 5, 2024
1 parent e953792 commit edc9d6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/raalabs-jira-assets-datasource/datasource.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DataFrame, DataQueryRequest, DataQueryResponse, DataSourceApi, DataSourceInstanceSettings, Field, FieldType, TestDataSourceResponse } from "@grafana/data";
import { getBackendSrv } from "@grafana/runtime";
import { getBackendSrv, getTemplateSrv } from "@grafana/runtime";
import { DataQuery, DataSourceJsonData } from "@grafana/schema";
import { AssetObject, ObjectAttributeValue, ObjectListInclTypeAttributesEntryResult, ObjectTypeAttribute } from "./types";

Expand All @@ -26,7 +26,7 @@ export class DataSource extends DataSourceApi<AssetsQuery, DataSourceOptions> {
async query(request: DataQueryRequest<AssetsQuery>): Promise<DataQueryResponse> {
const response: DataQueryResponse = { data: [] };
for (const target of request.targets) {
const aql = target.query;
const aql = getTemplateSrv().replace(target.query, request.scopedVars);
const result = await this.assetQuery(aql);
response.data.push({ ...result, refId: target.refId });
}
Expand Down

0 comments on commit edc9d6c

Please sign in to comment.