How to set the starting issue number for a project

お困りですか?

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

コミュニティに質問

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

症状

When creating a new project, you want to define the number that starts the project's issue ID's. For example, you want to start your project from JIRA-1000 and not JIRA-1.

Resolution for Server, Data Center, and Cloud

You can do it yourself by using the External System Import with a CSV file, the file should be formatted like this:

key,summary
<PROJECT_KEY>-<START_INDEX>,<ISSUE_SUMMARY>

An example, if you want your project to start the issues from 1001:

key,summary
TEST-1000,Dummy summary

This import must be performed by a Jira Admin in order to access the external system import.  Note: You cannot do this kind of import with the bulk issue creator, as that CSV import method does not allow you to set the specific Issue key value.

These steps also expect that when performing the import, you will select the specific single project to import to.  This cannot work if you select the option for 'Defined in CSV' during the CSV import setup process.

The single dummy issue created by the import process can be deleted afterwards. This will set the project issue number count to 1000, so the following issue will have the key TEST-1001.

Resolution for Server, and Data Center

データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。

The following process will help you modify that starting value

  1. Make backups of your database

  2. Shutdown Jira (Not applicable for Cloud)
  3. You should not change your counter value to anything lower than the newest created ticket value for your project, so run this query to find out what that value is:

    SELECT max(issuenum) 
    FROM jiraissue
    INNER JOIN project on project.id = jiraissue.project 
    WHERE project.pname = '<YOUR_PROJECT_NAME>';

    Make a note of this value.

  4. Set the pcounter value for your project to ONE LESS than your intended start (n-1). You CANNOT set your new starting number to anything lower than the value you got from the query in step 3.

    UPDATE project 
    SET pcounter = '<ONE_LESS_THAN_DESIRED_STARTING_VALUE>' 
    WHERE pname = '<YOUR_PROJECT_NAME>';
  5. Start Jira (Not applicable for Cloud)

Once Jira has started up the moment you create an issue in the project, it should assign to 1 number up from what you set.

最終更新日 2024 年 6 月 24 日

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

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