Custom Field not displayed when using Database Custom Field plugin

Carsten Hilber May 27, 2013

I have configured a custom field with the Keppler Database Custom Field plugin. I wanted to try with a simple select so I tried to configure a query which si statically giving back the number 3.

I turned on Debug and I can see the output like this:

2013-05-28 15:53:05,367 http-bio-8080-exec-37 DEBUG cahi 953x2048x4 1gpefkd 192.168.42.82 /secure/EditAction!default.jspa [databasecf.querydb.impl.QueryDatabaseImpl] Results for executing SQL query >>
select effort from psa_time_entry where task = '1819640'<< are >>[{EFFORT=3.0}]<<

As column I declared effort of course. My database user is read only and I just want to show the field as a text. I wouldn't care if it is shown in a combo though.

The issue is that the field is not shown at all. When I use the where is my field option it tells me that the field has no value and therefore it is not displayed.

Any ideas?

Carsten

4 answers

1 accepted

0 votes
Answer accepted
Alexandru_Iacob
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.
May 27, 2013

You can achieve what you are looking for by using the SIL Script Custom Field from our KCF plugin (Kepler Custom Fields - https://marketplace.atlassian.com/plugins/com.keplerrominfo.jira.plugins.keplercf) and the sql routine, which is documented here:

http://confluence.kepler-rominfo.com/display/SIL/sql

Documentation for the SIL script custom field usage is here:

http://confluence.kepler-rominfo.com/display/KCF/SIL+Script+Custom+Field

Basically, you should add a SIL script CF with the following script configured:

return sql("your JNDI datasource", "select effort from psa_time_entry where task = '1819640'");

The field will show you the desired value from database on view issue.

Make sure also that you choose the appropriate searcher for your field. In this case I suppose an Exact Number Searcher would be appropriate. For more details on SIL Script CF check the documentation link pointed above.

Hope this helps.

Carsten Hilber May 27, 2013

Great, thx!

0 votes
Carsten Hilber May 27, 2013

Ok, seems as if i had a different understanding of showing the value. You are right, when I edit the value and save it, then it is displayed correctly. But this value is changing in the database and I cannot always edit the issue to view the correct value...

Is there any solution for just displaying values from databases which are corresponding to the issue in JIRA but will never actively set through the issue? JIRA is not notified when the values are changed in the database :-(

regards Carsten

0 votes
Carsten Hilber May 27, 2013

Hi Alex,

First of all thanks for your quick answer.

I am using JIRA 5.2.4 and databasecf 2.1.12.

In the logfile are only some debug statements, nothing which would point that something would be wrong. And now that you mentioned it, the field is shown on the edit issue dialog, funny... In the Configure Fields option the field is also visible. So it is only not shown when I view the issue.

I am using Firefox, just to look if the problem occurs in different browsers I tried IE8 with the same result. I just reindexed and cleared the cache with no effect.

any ideas?

Thanks

Carsten

Alexandru_Iacob
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.
May 27, 2013

What configuration do you have for the dbcf field? You should choose type select list and uncheck "Add None option". However, you still need to enter on edit issue and save the value on issue, otherwise it won't be shown on the view issue screen, as it has no value.

0 votes
Alexandru_Iacob
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.
May 27, 2013

Hi Carsten,

What databasecf and jira version are you using and on what browser?

Are there any other messages in the log that might give a clue of what is causing the problem?

Do you experience this problem on all screens?

You could try performing a reindex and also cleaning the cache of your browser.

Is the field missing also from the list of custom fields shown when clicking on Configure Fields in the edit issue screen?

Regards,

Alex

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events