PocketQuery - SQL Query Parameter to Template

Hi,

Is there a way to reference a PocketQuery macro parameter in a template?

I have "hostname" param that is being passed to the SQL query:

select * from load_average where hostname=:hostname

can I reference the parameter in the template as well? Something like:

<script>

var options = { 
title: $hostname,
height: 300,
width: 600,
vAxis: { minValue: 0, maxValue: 1, format:'#%' },
hAxis: {slantedTextAngle:45},
legend: {position:'none'}
};

PocketQuery.chart('LineChart', options);

</script>

Thank you.

1 answer

1 accepted

This widget could not be displayed.

Hi Evgeny,

Yes you can! Try $queryParameters.hostname and it should work! Let me know if you need further help!

Regards, Felix

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

70 views 2 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you