Database values plugin - advanced search only by key

Hi,

I'm using the database values plugin. I've noticed that when doing an advanced search, you can only search by key.

For example: table contains the following data
key, number, summary, status
903, X/666, Project Summary string, Active

I've created a custom field called 'Project', the only advanced search that pulls back issues is

Project = '903'

The simple search displays columns according to search pattern below (see .properties) and when I change from simple to advanced search I see Project = '903'.

Is it possible to configure this plugin to search using some other column other than the key, when doing an advanved search? See .properties file extract below.

Any help appreciated,

# The SQL Query that will be executed on the database
sql.query=select id, number, summary, status, CASE when status = 'Active' THEN 1 when status = 'Closed' THEN 2 when status = 'Suspended' THEN 3 when status = 'Proposed' THEN 4 END AS statusOrder from nre ORDER BY statusOrder ASC, status ASC, number DESC

# The column number (starting from 0) that contains the primary key of the returned data.
primarykey.column.number=0
# The pattern that should be used to render the data in view mode. Use {column_number} as placeholders. You can use HTML, but make sure you close your tags properly!
rendering.viewpattern={1} - <span class="informal" style="color: grey;">{2}</span>
# The pattern that should be used to render the data in edit mode. Use {column_number} as placeholders.
rendering.editpattern={1} - {2}
# The pattern that should be used to render the data in searcher. Use {column_number} as placeholders.
rendering.searchpattern={1},{2},{3} ({0})
# This is used when sorting in the issue navigator. When not defined, the 'rendering.viewpattern' is used.
rendering.sortpattern={1},{2},{3}
# Use 0 to have a combobox for editing, 1 to have AJAX-style input field, 2 for cascading select
edit.type=2
rendering.editpattern.group.column.number=3
# Use 0 to have a list for searching, 1 to have AJAX-style input field
search.type=0
# The pattern that is used for the history and the activity view. If not specified, the 'rendering.viewpattern' is used. Note that you cannot use HTML.
rendering.changelog.viewpattern={1} {2} {3}
# The pattern that is used for the pie chart, 2d filter statistics and single level group by. If not specified, the 'rendering.viewpattern' is used. Note that you cannot use HTML.
rendering.statistics.viewpattern={1} {2} {3}

2 answers

1 accepted

Setting up a JQL query in the properties file sorts this for me.

Advanced search of -> "Project" in dbValuesMatching("NRE", "X/001")

pulls back the expected data.

# JQL query
jql.1.query.reference=NRE
jql.1.query=select id from nre where number = 'QUERY_VALUE'
jql.2.query.reference=Status
jql.2.query=select id from nre where status = 'QUERY_VALUE'

setting up a JQL query will sort this for me. using dbValuesMatching() in advanced search.
Search -> "Project" in dbValuesMatching("NRE", "X/001")
pulls back the expected data.

# JQL query
jql.1.query.reference=NRE
jql.1.query=select id from nre where number = 'QUERY_VALUE'
jql.2.query.reference=Status
jql.2.query=select id from nre where status = 'QUERY_VALUE'


					
				
			
			
			
				

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

Meet the AUG leaders of Northern Virginia

@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....

158 views 5 9
Read article

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