Issue Navigator does not show Select List for Multi-Select Searcher
症状
- Searching for specific values in Multi-Select Custom Field produces inconsistent results
- Sorting a list of issues by a Multi-Select Custom Field does not finish or returns an error
- This behaviour is only seen in issues created prior to upgrading to 4.3 or beyond
atlassian-jira.log
に次のエラーが返される。
/secure/IssueNavigator.jspa [velocity] Could not determine type of iterator in #foreach loop at [0,0] in template templates/plugins/fields/view-searcher/view-searcher-multioption.vm
原因
During the upgrade, the upgrader placed the literal string value into the customfieldvalue table, instead of the index to the customfieldoption table.
ソリューション
- To rectify this problem, you first have to identify the custom field that is affected.
a. Go to Administration > Issues > Custom Fields
b. Click the gear icon at the right end of the row corresponding with your malfunctioning custom field
c. Hover your mouse over the 'Configure' link
d. The URL should be displayed along the bottom of your browser window
e. The end of the URL will read customFieldId=<number>. This <number is your Custom Field ID
2. Identify the possible values for this field:
select * from customfieldoption where customfield=<idnumber>;
3. The output from that command will look like this:
ID | CUSTOMFIELD | CUSTOMFIELDCONFIG | PARENTOPTIONID | SEQUENCE | customvalue | optiontype | disabled |
---|---|---|---|---|---|---|---|
10030 | 10020 | 10002 | NULL | 2 | はい | NULL | NULL |
10031 | 10020 | 10002 | NULL | 1 | いいえ | NULL | NULL |
10730 | 10020 | 10002 | NULL | 0 | Not sure | NULL | NULL |
4. The error is that, for issues prior to the upgrade, the stringvalue of the customfieldvalue table uses the literal value from the customvalue field, and not the ID from the ID field. To correct this, UPDATE the customfieldvalue based on this information.
5. There should be one 'UPDATE' query performed for every line in this table, as shown below.
This is a sample query based on the results above. Your query WILL differ from this example.
BACK UP YOUR DATA!! UPDATE queries make permanent, irrevocable changes to your database.
UPDATE customfieldvalue SET stringvalue to '10030' WHERE stringvalue = 'Yes' AND customfield = '10020';
UPDATE customfieldvalue SET stringvalue to '10031' WHERE stringvalue = 'No' AND customfield = '10020';
UPDATE customfieldvalue SET stringvalue to '10730' WHERE stringvalue = 'Not sure' AND customfield= '10020';
For each field presenting this issue, repeat steps 1-5.