diff --git a/public/app/features/variables/utils.test.ts b/public/app/features/variables/utils.test.ts index e6ed4bc3fa1..90836b2d822 100644 --- a/public/app/features/variables/utils.test.ts +++ b/public/app/features/variables/utils.test.ts @@ -169,6 +169,7 @@ describe('ensureStringValues', () => { ${[1, 2]} | ${['1', '2']} ${'1'} | ${'1'} ${['1', '2']} | ${['1', '2']} + ${true} | ${'true'} `('when called with value:$value then result should be:$expected', ({ value, expected }) => { expect(ensureStringValues(value)).toEqual(expected); }); diff --git a/public/app/features/variables/utils.ts b/public/app/features/variables/utils.ts index 2b7c5842769..e62a7850827 100644 --- a/public/app/features/variables/utils.ts +++ b/public/app/features/variables/utils.ts @@ -239,5 +239,9 @@ export function ensureStringValues(value: any | any[]): string | string[] { return value; } + if (typeof value === 'boolean') { + return value.toString(); + } + return ''; }