Issue Types: Sub-Task always created as Standard issue type


#1

I have a plugin which creates two issue types, one standard and one as a sub-task. Not matter what combination I try my sub-task issue type is always created as “Standard”.

I have tried the following variations:

  1. constantsManager.insertIssueType(name, 0L, issueType, description, avatarId); where issueType is jira_subtask, subtask, SUBTASK, SubTaskManager.SUB_TASK_ISSUE_TYPE_STYLE.
  2. SubTaskManager.insertSubTypeIssueType(name, 0L, description, avatarId);
  3. IssueTypeManager.createSubTaskIssueType(name, description, avatarId);

In all these variations the issue type is created but it’s ‘type’ is Standard, not Sub-Task.
I have ensured the avatarId exists and is valid, name is non-empty along with description and I have ensured Subtasks are enabled in the Jira Server environment.

Anyone offer insight? Am I missing something simple?

Thanks!


#2

Resolved the issue on my own. I’ll post it here in case anyone else runs into a similar issue. I had some ‘provisioning’ code that would create the issue types, upload an avatar and then update the issue type with the avatar among some other steps. Turns out my code for the creation was fine, but the update was doing a check if the issue type property isSubTask() was true, and if so setting the style property to SUBTASK. Turns out the style property should of been jira_subtask so it was effectively changing the issue type BACK to standard on update (which I didn’t even know was possible - given the UI doesn’t allow you to).