All tabs on Project Template screens have the same first 4 fields

It’s me again and yes, still working on my project template :grinning: Now I’m stuck trying to figure out why all the tabs on my screens have the same first four fields:

Summary
Issue Type
Reporter
Epic Name

I have 5 tabs on my screen and they all start with those 4 fields! Here is my .json config:

{
    "issue-type-scheme":
    {
        "name": "standard.project.template.issuetype.scheme.name",
        "description": "standard.project.template.issuetype.scheme.description",
        "issue-types": [
            {
                "key": "storyIssueType",
                "name": "Story",
                "icon": "/images/icons/story.png"
            },
            {
                "key": "bugIssueType",
                "name": "Bug",
                "icon": "/images/icons/bug.png"
            },
            {
                "key": "subTaskIssueType",
                "name": "Sub-Task",
                "icon": "/images/icons/subtask_alternate.png",
                "sub-task": true
            },
            {
                "key": "epicIssueType",
                "name": "Epic",
                "icon": "/images/icons/epic.png"
            },
            {
                "key": "taskIssueType",
                "name": "Task",
                "icon": "/images/icons/task.png"
            }
        ]
    },
    "issue-type-screen-scheme":
    {
        "name": "DT Issue Type Screen Scheme",
        "description": "Screens used for default projects",
        "default-screen-scheme": "dtScreenScheme",
        "screens": [
            {
                "key": "dtScreen",
                "name": "DT Screen",
                "tabs": [
                    {
                        "name": "Standard Fields",
                        "fields":[
                            "issuetype",
                            "summary",
                            "reporter",
                            "components",
                            "priority",
                            "fixVersions",
                            "description",
                            "labels",
                            "attachment",
                            "issuelinks"
                        ]
                    },
                    {
                        "name": "Sprint Planning",
                        "fields":[
                            "customfield_10000",
                            "customfield_10001",
                            "customfield_10006",
                            "customfield_10101"
                        ]
                    },
                    {
                        "name": "Assign, Estimate hours",
                        "fields":[
                            "assignee",
                            "Original Story Points",
                            "timetracking",
                            "duedate"
                        ]
                    },
                    {
                        "name": "Portfolio",
                        "fields":[
                            "Target start",
                            "Target end",
                            "Team"
                        ]
                    },
                    {
                        "name": "Log Work",
                        "fields":[
                            "Flagged",
                            "environment",
                            "worklog"
                        ]
                    }
                ]
            }
        ],
        "screen-schemes": [
            {
                "key": "dtScreenScheme",
                "name": "DT Screen Scheme",
                "default-screen": "dtScreen"
            }
        ]
    }
}

I know that not all the fields are valid–I found out midway that I need to provide the ‘customfield’ version of the field (which sucks because tests in other environments don’t work), but I don’t think that is the problem. I just can’t figure out why those 4 fields are on every tab. I’m going to test removing the invalid fields now, but wanted to get this question out first.

Nope, still get the same 4 fields. I noticed that it is the same 4 fields as on a scrum project screen, so it must be the default that can’t be overridden. I’ll just try building the screen from scratch or copying an existing screen rather than use the project template config file.

The Project Template plugin appears hard coded for this behavior. Your only real option would be to cleanup the screens after-the-fact in the server-side hook. The behavior is within the CustomScreenServiceImpl.java class – It determines any required field for any issuetype in the project and adds all those fields to the screens created with a Project Template every time – This includes the Epic Name field, which is required on the Epic, if the Epic issue type is included within the project.

Yeah, that’s what I thought. The unfortunate thing is that if you have more than one tab, it adds the fields to all the tabs which is not a valid screen. So when I tried cleaning up the fields, I got some unpredictable behavior. Pretty sure that should be considered a bug. In the end I created a template screen that I copy rather than use the template config .json.

I completely agree. I have already submitted another bug for different bad behavior from the Project Template plugin. It’s a shame, it had a chance to be as powerful as Confluence Templates.