Editing Perforce job configurations in the JIRA database
症状
Perforce job configurations cannot be edited in the JIRA UI, according to the bug ticket : - JRA-33793Getting issue details... STATUS
回避策
The Perforce configurations can be directly editted in the JIRA database.
Notice
Please ensure that to have a backup of JIRA database handy before performing any direct database manipulation. Atlassian will not be held responsible for any lost of data due to the absence of backups.
手順:
Run the following SQL in the JIRA database to pick up all the Perforce configurations:
SQLSELECT propertyentry.ID, propertyentry.ENTITY_NAME, propertyentry.ENTITY_ID, propertyentry.PROPERTY_KEY, propertystring.propertyvalue, propertytext.propertyvalue FROM propertyentry LEFT JOIN propertystring ON propertyentry.ID = propertystring.ID LEFT JOIN propertytext ON propertyentry.ID = propertytext.ID WHERE PROPERTY_KEY LIKE "fisheye.p4%";
- The results will look like the following:
- The first 4 columns come from the propertyentry table which stores the type of configuration for a Perforce job, e.g. port, perforce executable etc.
- The first propertyvalue column stores the config value in the propertystring table, while the second propertyvalue column stores the config in the propertytext table.
The property_key column is self explanatory, with the numbering fisheye.p4.X coinciding with the ID of the Perforce job. So if you have 3 perforce job configurations in JIRA, it will show as:
fisheye.p4.1.configname fisheye.p4.1.configname fisheye.p4.1.configname fisheye.p4.2.configname fisheye.p4.2.configname fisheye.p4.2.configname fisheye.p4.3.configname fisheye.p4.3.configname fisheye.p4.3.configname
We can follow this comment to determine which Perforce job configuration is related to which ID, by replacing the URL with the ID as per the PROPERTY_KEY column above.
- To change the configuration, refer to the ID of the table above, e.g. ID = 13771 relates to the job configuration charset for the job with ID = 7. Since its value is in the first propertyvalue column, we know that its in the propertystring table.
Run the following to change the value:
SQLUPDATE propertystring SET propertyvalue = 'utf8-bom' WHERE ID = 13771;
Here we are changing the charset of the perforce job configuration to utf8-bom.
For configuration with ID = 13766, its the job configuration executable for job ID = 7. Since its value is the second propertyvalue column, we know that its in the propertytext table.
SQLUPDATE propertytext SET propertyvalue = 'c:\Program Files\Perforce2\p4.exe' WHERE ID = 13766;
Finally, restart JIRA for the changes to be applicable.