JIRA throws NumberFormatException when adding new issue types
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
問題
When trying to create new issue types - Standard or Sub-Task, an error is thrown in the web-browser.
次のようにします。
- Navigate to Administration > Issues
- Click + Add Issue Type
- Selecting either Standard Issue Type or Sub-Task Issue Type and submit
The following appears in the on screen.
Referer URL: https://<server-name>/secure/admin/ViewIssueTypes.jspa
java.lang.NumberFormatException: null
java.lang.NumberFormatException: null
at java.lang.Long.parseLong(Long.java:404)
at java.lang.Long.parseLong(Long.java:483)
at com.atlassian.jira.config.DefaultIssueTypeService.createIssueTypeOrSubTaskType(DefaultIssueTypeService.java:357)
at com.atlassian.jira.config.DefaultIssueTypeService.createIssueType(DefaultIssueTypeService.java:174)
at com.atlassian.jira.web.action.admin.issuetypes.ViewIssueTypes.doAddIssueType(ViewIssueTypes.java:117) ...
診断
Diagnostic Steps
Run the following SQL command to see if it returns back empty
select id from propertyentry where property_key = 'jira.avatar.issuetype.default.id'
原因
The error is caused by an empty jira.avatar.issuetype.default.id in the database
回避策
データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。
- Please stop the JIRA Server
- Run the following SQL queries
insert into propertyentry
(id, entity_name, entity_id, property_key, propertytype)
select
4, 'jira.properties', 1, 'jira.avatar.issuetype.default.id', 5
where not exists
(select id from propertyentry where property_key = 'jira.avatar.issuetype.default.id');
insert into propertystring
(id, propertyvalue)
select
(select id from propertyentry where property_key = 'jira.avatar.issuetype.default.id' limit 1), '10300'
where not exists
(select id from propertyentry pe inner join propertystring ps using (id)
where pe.property_key = 'jira.avatar.issuetype.default.id');
insert into propertyentry
(id, entity_name, entity_id, property_key, propertytype)
select
2, 'jira.properties', 1, 'jira.avatar.issuetype.subtask.default.id', 5
where not exists
(select id from propertyentry where property_key = 'jira.avatar.issuetype.subtask.default.id');
insert into propertystring
(id, propertyvalue)
select
(select id from propertyentry where property_key = 'jira.avatar.issuetype.subtask.default.id' limit 1), '10316'
where not exists
(select id from propertyentry pe inner join propertystring ps using (id)
where pe.property_key = 'jira.avatar.issuetype.subtask.default.id');
- Restart your JIRA Server