Indexing breaks after upgrading to Advanced Roadmaps to Jira 3.29.2 when Team field was renamed or is missing

お困りですか?

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

コミュニティに質問

プラットフォームについて: 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 Advanced Roadmaps for Jira (ARJ) custom field called Team was renamed, then after upgrading to ARJ 3.29.2, the index will break. This includes:

  • Jira's full reindexing 
  • Any indexing action triggered by issue action, for example, creating an issue, or transitioning an issue.

In atlassian-jira.log, we will see:

2020-12-13 19:21:15,186+0000 https-jsse-nio-8443-exec-166 WARN XXXXX XXXXxXXXXXxX XXXXXXX XXX.XXX.XXX.XX,XX.XX.XXX.XX /secure/WorkflowUIDispatcher.jspa [c.a.jira.index.AccumulatingResultBuilder] java.lang.IllegalStateException: Team custom field ID cannot be found
java.lang.RuntimeException: java.lang.IllegalStateException: Team custom field ID cannot be found
	at com.atlassian.jira.index.DefaultIndex$Failure.<init>(DefaultIndex.java:100)
	at com.atlassian.jira.issue.index.DefaultIssueIndexer$EntityOperation.perform(DefaultIssueIndexer.java:838)
	at com.atlassian.jira.issue.index.DefaultIssueIndexer.lambda$null$4(DefaultIssueIndexer.java:513)
...
Caused by: java.lang.IllegalStateException: Team custom field ID cannot be found
	at com.atlassian.rm.teams.customfields.team.TeamCustomFieldTypeHelper.getCustomFieldId(TeamCustomFieldTypeHelper.java:74)
	at com.atlassian.rm.teams.customfields.team.TeamCustomFieldType.getCustomFieldId(TeamCustomFieldType.java:44)

Or is it also possible to see:

2023-05-11 07:49:36,797+0200 http-nio-8080-exec-22 WARN XXXXX XXXXxXXXXXxX XXXXXXX XXX.XXX.XXX.XX,XX.XX.XXX.XX /rest/jpo/1.0/issues/commit [c.a.r.j.c.scenario.common.BaseScenarioEntityCommitService] Error in commit operation.
com.atlassian.rm.jpo.env.issues.EnvironmentIssueServiceException: could not create issue from scenario issue.
        at com.atlassian.rm.jpo.env.issues.JiraIssueService.createIssue(JiraIssueService.java:178)
        at com.atlassian.rm.jpo.core.scenario.issue.ScenarioIssueCreateAction.performApiOperation(ScenarioIssueCreateAction.java:88)
        at com.atlassian.rm.jpo.core.scenario.issue.ScenarioIssueModificationAction.perform(ScenarioIssueModificationAction.java:317)
        at com.atlassian.rm.common.persistence.transaction.Registry.run(Registry.java:35)
        at com.atlassian.rm.jpo.core.scenario.issue.ScenarioIssueCommitService.add(ScenarioIssueCommitService.java:137)
        at com.atlassian.rm.jpo.core.scenario.issue.ScenarioIssueCommitService.add(ScenarioIssueCommitService.java:47)
        at com.atlassian.rm.jpo.core.scenario.common.BaseScenarioEntityCommitService.addInternal(BaseScenarioEntityCommitService.java:349)
        at com.atlassian.rm.jpo.core.scenario.common.BaseRankableScenarioEntityCommitService.addInternal(BaseRankableScenarioEntityCommitService.java:68)
        at com.atlassian.rm.jpo.core.scenario.common.BaseScenarioEntityCommitService.executeOperation(BaseScenarioEntityCommitService.java:428)
        at com.atlassian.rm.jpo.core.scenario.common.BaseScenarioEntityCommitService.transactionalCommitInternal(BaseScenarioEntityCommitService.java:291)
        at com.atlassian.rm.jpo.core.scenario.common.BaseScenarioEntityCommitService$2.apply(BaseScenarioEntityCommitService.java:257)
        at com.atlassian.rm.jpo.core.scenario.common.BaseScenarioEntityCommitService$2.apply(BaseScenarioEntityCommitService.java:252)
        at com.atlassian.rm.common.persistence.transaction.TransactionHandler.inTransaction(TransactionHandler.java:111)
        at com.atlassian.rm.common.persistence.transaction.TransactionHandler.inNewTransaction(TransactionHandler.java:99)
        at com.atlassian.rm.common.persistence.transaction.TransactionHandler.inNewTransaction(TransactionHandler.java:89)
...
Caused by: java.lang.RuntimeException: Required custom field with key com.atlassian.teams:rm-teams-custom-field-team not found
        at com.atlassian.rm.jpo.env.customfields.JiraCustomFieldService.lambda$getRequiredGlobalCustomFieldWithLowestId$1(JiraCustomFieldService.java:299)
        at java.base/java.util.Optional.orElseThrow(Unknown Source)
        at com.atlassian.rm.jpo.env.customfields.JiraCustomFieldService.getRequiredGlobalCustomFieldWithLowestId(JiraCustomFieldService.java:299)
        at com.atlassian.rm.jpo.env.customfields.JiraCustomFieldService.getCustomFieldIdAsLongByTypeKey(JiraCustomFieldService.java:289)
        at com.atlassian.rm.jpo.env.issues.JiraIssueService.setDefinedInputParameters(JiraIssueService.java:912)
        at com.atlassian.rm.jpo.env.issues.JiraIssueService.createIssue(JiraIssueService.java:150)
        ... 301 more


診断

Run SQL query to verify the ARJ team fields

select * from customfield where customfieldtypekey = 'com.atlassian.teams:rm-teams-custom-field-team';


(info) This by default should return a custom field where cfname = Team

If the returned result indicates cfname to be other than Team or if there are no results, this KB article is applicable to you.

原因

In ARJ 3.29.2, in order for ARJ custom field to be included in Jira's indexing improvement, ARJ is referring to its fields by name.

JPOSERVER-2924 - Getting issue details... STATUS  on this subject has been fixed for Jira 8.15.1 / Advanced Roadmaps 3.29.6 and later.

ソリューション

Field renamed

Always consult with Atlassian support team to verify you steps, and always generate a backup prior to making any changes. Test this in your staging instance prior to implement this in your production instance.

  1. Unlock the ARJ team field from the database, following this KB article: Unlock a locked Jira Software custom field
  2. Rename the ARJ custom field back to its original name: Team.
  3. Lock the team custom field again, to prevent accidental changes in the future.

(info) Renaming issue fields would affect the saved filters that refer to them in JQL. Make sure to update the JQL of those saved filters as well. 

Field missing

  1. Stop your Jira nodes
  2. Perform a backup of your database
  3. Run the following query to add the custom field to your database:

    INSERT INTO CUSTOMFIELD (ID,CUSTOMFIELDTYPEKEY, CUSTOMFIELDSEARCHERKEY, CFNAME, DESCRIPTION)
     VALUES ((SELECT max(id)+1 FROM CUSTOMFIELD),'com.atlassian.teams:rm-teams-custom-field-team', 'com.atlassian.teams:rm-teams-custom-field-team-searcher', 'Team','The team field. This custom field is created and required by Portfolio for Jira.');
  4. Start your Jira nodes and verify if the custom field is shown on page $Jira-URL/secure/admin/ViewCustomFields.jspa and configure a new context;
    1. If everything in Step 2 worked and you can see the field correctly, please proceed with the next steps;
    2. Search for "Team" (1) and click "Configure" (2)
    3. screenshot-1.png
    4. Click "Add new context".
    5. Fill in the label, e.g. "Default Configuration Scheme for Team". Leave the other fields as is.
    6. screenshot-2.png
    7. Click add.
  5. Get the new custom field ID by running this query:

    select * from customfield where customfieldtypekey = "com.atlassian.teams:rm-teams-custom-field-team";
  6. Stop Jira again;
  7. Lock the field on the table MANAGEDCONFIGURATIONITEM using the query below. Replace the customfield_<ID> below with the new custom field ID from the query above:

    INSERT INTO MANAGEDCONFIGURATIONITEM (ID,ITEM_ID, ITEM_TYPE, MANAGED, ACCESS_LEVEL, SOURCE, DESCRIPTION_KEY)
    VALUES ((SELECT max(id)+1 FROM MANAGEDCONFIGURATIONITEM),'customfield_<ID>', 'CUSTOM_FIELD', 'true', 'LOCKED','com.atlassian.jpo:field-locking-service','admin.managed.configuration.items.generic.description.locked');
  8. Start your Jira cluster;
  9. Verify that the Team field is locked by visiting $Jira-URL/secure/admin/ViewCustomFields.jspa

最終更新日 2023 年 6 月 26 日

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

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