Customfield with external SQL Query

Jan Sękara January 18, 2018

Hi,

I need to query external SQL server,

 

select * from XYZ where customfield_10300 = project_id

 

or better, execute procedure

exec give.me.data {customfield_10300}


Is it possible?
I have bought plugin below but it doesn't cover my needs.

Power Database Fields PRO

 

1 answer

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2018

Hello,

You can do it the Power Database Fields PRO. It is called Dynamic queries. Kindly read here

https://confluence.cprime.io/pages/viewpage.action?pageId=6556967

Jan Sękara January 22, 2018

Yes, but it doesnt work as i want it to...

I can't configure it so it would refresh when opening an issue.

This customfields can only be either as a select list or autocomplete.


Or maybe i'm missing something.

Use case is to have a field that queries database with every issue refresh.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 22, 2018

It must work like this. What is in your case? When is it refreshed?

Jan Sękara January 22, 2018

Alexey,

As i see it, i can only connect a datasource, and create a customfield which will be filled while creating or editing issue.

Then it works.

My case:

Let's say i have an existing issue with customfield customfield_10300. This is normal number customfield.

And i want to add NEW customfield that will query external SQL and display data basing on existing customfield's 10300 value.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 22, 2018

Ok, suppose you have a number field with customfield_10300. Then you add a new field which must select data from the database, filtered by the value of the customfield_10300. Then you need to create a new Database Pro Field with a query like this

SELECT id, col2, col3, col4 FROM testTable WHERE id = {customfield_10300}

In this case the values in the new database field will be taken from the database filtered by the value in customfield_10300.

Jan Sękara January 30, 2018

Alex,

Customfield select is not an issue.


Let me explain again.

I've added a database customfield testdbinfo:

https://ibb.co/dkUQuR


Then, i've added it to the desired screen:

 https://ibb.co/j1Gig6

Then, i've checked if it is working... it is.

 https://ibb.co/cdNdER

It shows value  only when I edit and set it manualy.

But, the problem is, that it's not showing on the issue screen by default.

I want to add one field that will automaticly show on all issues.

https://ibb.co/jF93g6

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 30, 2018

I think I understood your question. You mean that it is not on the view screen unless you chose a value for the field. If so then it is how custom fields behave. They can be seen on the view screen if there is a value. If there is no value, then it will be hidden. That is how Jira works.

Jan Sękara January 30, 2018

So maybe this is a feature for the future, to show external info in the issue view. I think many people would benefit from it.

Suggest an answer

Log in or Sign up to answer