Empty Screens page in Project settings when creating IssueTypeScreenScheme

Hello,
I’m developing a server plugin that initializes a custom workflow. Workflows are designed in the Jira and exported to jwb files. The code of plugin then:

  • creates a new Project using ProjectService
  • creates custom Issue types using IssueTypeManager
  • imports jwb files using JiraWorkflowSharingImporter
  • creates Screen schemes (FieldScreenScheme)
  • creates Issue type screen scheme (IssueTypeScreenScheme)

Just for reference, this is how is the Screen scheme and Issue type screen scheme created.

// Creates empty Issue type screen scheme
issueTypeScreenScheme = new IssueTypeScreenSchemeImpl(issueTypeScreenSchemeManager);
issueTypeScreenScheme.setName("Name");
issueTypeScreenScheme.store();

// This method returns the screen, that was imported from jwb file
FieldScreen screen = getExportedIssueScreen();
// Screen scheme creation
FieldScreenSchemeImpl screenScheme = new FieldScreenSchemeImpl(fieldScreenSchemeManager);
screenScheme.setName("Name");
// Associate operation with screen (this is repeated in code for Edit and Create operations)
FieldScreenSchemeItem newSchemeItem = new FieldScreenSchemeItemImpl(fieldScreenSchemeManager, fieldScreenManager);
newSchemeItem.setIssueOperation(IssueOperations.VIEW_ISSUE_OPERATION);
newSchemeItem.setFieldScreen(screen);
// And set this association to Screen scheme
screenScheme.addFieldScreenSchemeItem(newSchemeItem)

// Associate issue type with Screen scheme
screenSchemeEntity = new IssueTypeScreenSchemeEntityImpl(issueTypeScreenSchemeManager, fieldScreenSchemeManager, constantsManager);
screenSchemeEntity.setIssueTypeId(issueType.getId()); 
screenSchemeEntity.setFieldScreenScheme(screenScheme);
// Set this association to Issue type screen scheme
issueTypeScreenScheme.addEntity(screenSchemeEntity);

// Associate Issue type screen scheme with project
issueTypeScreenSchemeManager.addSchemeAssociation(project, issueTypeScreenScheme);

The Issue type screen scheme is associated with the new project, but this step breaks the Jira somehow. When I go to Jira Administration → Issues → Issue type screen schemes, I can see the new ITSS associated to project. The ITSS contains Screen schemes and these schemes have Screens. It’s all fine. But when I open the Project settings, the summary page is missing the section Screens. And when I open the project page Screens, it’s completely empty.



There is no error in the browser log, no 500 response, and no error in the SQL logs. A weird NPE warnings are in the Jira logs though. One is logged when I open the summary page and one when I open the page Screens. It could be related but the message is not very specific.

2022-10-12 13:37:10,453 http-nio-2990-exec-2 WARN admin 817x7605x1 18ft9ph 0:0:0:0:0:0:0:1 /plugins/servlet/project-config/IRBCD/summary [c.atlassian.ozymandias.SafePluginPointAccess] Unable to run plugin code because of 'java.lang.NullPointerException - null'.
2022-10-12 13:37:26,184 http-nio-2990-exec-6 WARN admin 817x7767x1 18ft9ph 0:0:0:0:0:0:0:1 /plugins/servlet/project-config/IRBCD/screens [c.atlassian.ozymandias.SafePluginPointAccess] Unable to run plugin code because of 'java.lang.NullPointerException - null'.

I tested the behavior with Jira 8.1.0 and also 9.2.0 with the same result. The plugin itself behaves fine and everything looks correct from Jira Administration → Issues side. But when opened from the Project settings side, the content is missing and the page looks broken because of this.

  • Did something like this happen to you?
  • Are you creating Issue type screen schemes successfully from the code?
  • Do you think my code is wrong?
  • Or do you think this is a bug in the Jira API?

I know that cloud Jira is the thing right now so any help or hint would be appreciated. Thank you.