Jira Server で課題を別のタイプに移動すると、課題タイプが無効であるというエラーがスローされる

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Cloud、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 は除く

症状

  1. In JIRA applications, when moving issues from one Issue Type to another one or even between projects, the operation fails with the below error message;


    The issue type selected is invalid

  2. When moving an issue to another project, the project selection may not be correctly displayed. In this case, the below error can be seen in the browser's console;

    Uncaught TypeError: Cannot read property 'toLowerCase' of undefined

原因

In a JIRA, the "Default Issue Type Scheme" should include all issue types present on the instance. When that's not the case, multiple problems can occur, such as the failure when moving issues.

There is a bug raised to fix this problem:  JRA-46227 - Getting issue details... STATUS

For more information on Atlassian bug fix policy, please check the this page.



There are two possible causes for problems related to this.

  1. When the target issue type is not included in "Default Issue Type Scheme". You can determine which issue types are missing on that scheme by running the following query on the JIRA database;

    SELECT id, pname FROM issuetype WHERE id NOT IN (SELECT optionid FROM optionconfiguration WHERE fieldconfig = 10000 AND fieldid = 'issuetype');
    
  2. When JIRA somehow reads another Issue Type Scheme as the default, instead of the "Default Issue Type Scheme";

    This can be determined by running the following query against your database. The id returned should be 10000. If it's not 10000, then follow the workaround below.

    select id from configurationcontext where customfield = 'issuetype' and project is null
    

回避策

原因 1

As most default schemes in JIRA the "Default Issue Type Scheme" is read-only, so we need to manually add the missing issue types through the database.

If you are using *JIRA Cloud* please reference this document for the workaround.

As manual data manipulation will be necessary, please make sure you have an up-to-date backup of JIRA.

tip/resting Created with Sketch.

The SQL shown below applies to PostgreSQL and may need to be modified to work in other databases


  1. Shut down JIRA;
  2. Identify the missing values:

    SELECT id, pname FROM issuetype WHERE id NOT IN (SELECT optionid FROM optionconfiguration WHERE fieldconfig = 10000 AND fieldid = 'issuetype');
  3. Use the following SQL statement to add the missing entries from previous step. Repeat the query as many times as necessary until you've added all missing issue types;

    INSERT INTO optionconfiguration VALUES ((SELECT MAX(oc.id)+1 FROM optionconfiguration oc), 'issuetype', '<missing_issue_type_id>', 10000, (SELECT MAX(oc.sequence)+1 FROM optionconfiguration oc WHERE oc.fieldconfig=10000));

    (info) Replace <missing_issue_type_id> with the ID of the missing field;

  4. Fix the sequence_value_item table to avoid key violations

    UPDATE sequence_value_item SET seq_id = (SELECT MAX(id)+100 FROM optionconfiguration) WHERE seq_name = 'OptionConfiguration'; 
  5. Jira を起動します。

  6. Go to Administration > System > Indexing and perform a full re-index by selecting the Lock JIRA and re-build indexes option;


tip/resting Created with Sketch.

Temporary workaround without fixing the DB

Some customers reported that this worked for them:

Search for issue through the issue navigator and use the bulk change to move the issue.

原因 2

This will restore 'Default Issue Type Scheme' as the default scheme JIRA application uses

  1. Shut down JIRA;
  2. Run the below SQL queries in JIRA's database;

    DELETE FROM configurationcontext WHERE id IN (SELECT cc.id FROM configurationcontext cc WHERE cc.customfield = 'issuetype' AND project IS NULL);
    INSERT INTO configurationcontext VALUES (10000, NULL, NULL, 'issuetype', 10000);
  3. Fix the sequence_value_item table to avoid key violations

     UPDATE sequence_value_item SET seq_id = (SELECT MAX(id)+100 FROM configurationcontext) WHERE seq_name = 'ConfigurationContext'; 
  4. Jira を起動します。

最終更新日: 2023 年 2 月 1 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.