Jira Database Values plugin: how to use in API JQL?

I have a Jira 6.1 install with the Database Values Plugin v 3.0
I create a field (# 10190, name CustomerDB) which gets additional info from another DB.
I'm trying to use this as part of a REST API query.
It works well in the fields selection: I can add &fields=customfield_10190 to have it in the produced fields. But I can't make it work in the jql itself.

I tried:

  • /rest/api/latest/search?jql=CustomerDB="36"
    • (this doesn't return any result, although it should)
  • /rest/api/latest/search?jql=CustomerDB in dbValuesMatching("CustomerDB","847")&fields=customfield_10190
    • "The query reference 'CustomerDB' does not exist. Possible values are: []"

Here's the properties file:

database.driver=net.sourceforge.jtds.jdbc.Driver
database.user=...
database.password=...
database.connection.url=jdbc:jtds:sqlserver:....
cache.timeout=1
sql.query=select SERNUM, CUSTNAME, CUSTDES, SERN from dbo.SERNUMBERS LEFT JOIN CUSTOMERS ON SERNUMBERS.CUST=CUSTOMERS.CUST WHERE PART=5 ORDER BY SERNUM;
primarykey.column.number=3
rendering.viewpattern={0} (Customer {1} - {2})
rendering.editpattern={0} (Customer {1} - {2})
rendering.searchpattern={0} (Customer {1} - {2})
edit.type=0
search.type=0
jq1.1.query.reference=CustomerDB
jql.1.query=select SERNUM from dbo.SERNUMBERS WHERE SERN='QUERY_VALUE';

Any clue?

Thanks

2 answers

1 accepted

The plugin makes it so that there's apparently no way you can query any database field. You can only use the primary key of the DB like this:

/rest/api/2/search?jql=CustomerDB=23&fields=...

Does the JQL work if you type it in JIRA itself ? If not, then try to get that working first.

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,950 views 12 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