Wiki

Clone wiki

projectspecificselectfield-public / SQL API

Project Specific Select Field / SQL API

Adding and disabling option values can be done via SQL API for custom fields of type Project Specific Select Field (simple). For custom fields of type Project Specific Select Field and Project Specific Multi Select Field please use REST API.

Getting custom fields

To get a list of all Project Specific Custom fields available use the following SQL statement which is quering the table customfield.

SELECT * from CUSTOMFIELD WHERE 
CUSTOMFIELDTYPEKEY LIKE 'jira.plugin.projectspecificselectfield.jpssf%';

Getting option values

All option values of Project Specific Select Field (simple) are stored in the table AO_9661E7_SELECT_OPTION.

SELECT * from AO_9661E7_SELECT_OPTION

For custom fields of type Project Specific Select Field and Project Specific Multi Select Field please use get the list of option values from the table customfieldoption or use the REST API.

SELECT * from CUSTOMFIELDOPTION

Don't use SQL to update or insert in tables like customfieldoption, customfieldvalue or even configurationcontext, fieldconfigscheme or fieldconfiguration, because SQL inserts or updates are not supported by Jira and these tables are Jira core data model tables.

Adding option value

Use SQL insert to add new option values for custom fields of type Project Specific Select Field (simple) as shown below. For custom fields of type Project Specific Select Field and Project Specific Multi Select Field please use REST API.

INSERT INTO AO_9661E7_SELECT_OPTION (CUSTOM_FIELD_ID, PROJECT_ID, OPTION_VALUE, DISABLED)
VALUES (10400, 10000, 'New Value', false);

Please make sure you also set ID value propery in table AO_9661E7_SELECT_OPTION when adding new rows.

Disabling option values

If you want to disable an option value of custom field type Project Specific Select Field (simple) please use SQL update as shown below. For custom fields of type Project Specific Select Field and Project Specific Multi Select Field please use REST API.

UPDATE AO_9661E7_SELECT_OPTION
SET DISABLED = true
WHERE CUSTOM_FIELD_ID=10400 and PROJECT_ID=10000 and OPTION_VALUE='My Value';

Updated