Sql macro plugin

Hello all

We are trying to manipulate table data using math operation. As part of populating the report we are using sql macro to capture the data as follows

DECLARE @kloc_total float
DECLARE @var1 float
select @kloc_total = total from ##kloc
select @kloc_total/1000{sql}

We want to capture the above result to a varible and use the variable in java script further manipulate the result before rendering back to the page.

Manipulation we are trying to make is doing some math on the result in the form of multiplication.

Can anybody point me in the right direction how this can achieved.



2 answers

Generally speaking it is best to just let your SQL query do the math for you and if necessary, add some sql functions to your database to make it easier. A simple example would be:

select sum(kloc)/1000 from klocTable

You can also use a groovy or other script to manipulate the results (How to generate choice values using SQL shows some techniques in this area), but normally not needed if you have someone with sql skills.

Thanks Bob

Based on your other comments on different issues i have used replace-and-render macro to get this working.



Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,802 views 11 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot