Database values plugin - advanced search only by key

Ryan Aherne
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.
October 14, 2012

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

0 votes
Answer accepted
Ryan Aherne
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.
October 14, 2012

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'

0 votes
Ryan Aherne
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.
October 14, 2012
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