Issue Summary
If the View Settings page of a plan is configured with a Colour By configuration pointing to an unavailable issue type, this page will fail to load. It will be blank, and the following error will be thrown:
Uncaught TypeError: Cannot read properties of undefined (reading 'name')
Steps to replicate
- Create 2 projects (for example, one project called SCRUM, and one called KANBAN)
- Create 2 issue type schemes, and make sure that one scheme has an extra issue type not availabe in the other scheme
- Associate each project with a different issue type scheme. For example, in the example below, the SCRUM project is associated to the scheme that has an extra issue type (Initiative type). The Initiative type is not available to the KANBAN project:
- Create a new plan, and add the SCRUM project as the source
- Open the View Settings menu from the plan, and associate a colour to the issue type "Initiative" via the Colour by setting:
- Change the plan source by replacing the project SCRUM with the KANBAN project as the source:
- Try to open View Settings menu from the plan
Expected Results
The View Settings should open
Actual Results
- The page is blank, with the error "something went wrong" at the bottom
- When clicking on the View Log button, the following stack trace is shown:
Stack Trace Uncaught TypeError: Cannot read properties of undefined (reading 'name') TypeError: Cannot read properties of undefined (reading 'name') at https://linux-31012.prod.atl-cd.net/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/zdizrv/820015/1dlckms/8.20.15/_/download/batch/com.atlassian.jpo:jpo-wr-page-simple-plans-scripts/com.atlassian.jpo:jpo-wr-page-simple-plans-scripts.js:5:1328412 at Array.map (<anonymous>) at n.issueTypeIdsToOptions (https://linux-31012.prod.atl-cd.net/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/zdizrv/820015/1dlckms/8.20.15/_/download/batch/com.atlassian.jpo:jpo-wr-page-simple-plans-scripts/com.atlassian.jpo:jpo-wr-page-simple-plans-scripts.js:5:1328347) at https://linux-31012.prod.atl-cd.net/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/zdizrv/820015/1dlckms/8.20.15/_/download/batch/com.atlassian.jpo:jpo-wr-page-simple-plans-scripts/com.atlassian.jpo:jpo-wr-page-simple-plans-scripts.js:5:1329683 at Array.map (<anonymous>) at n.value (https://linux-31012.prod.atl-cd.net/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/zdizrv/820015/1dlckms/8.20.15/_/download/batch/com.atlassian.jpo:jpo-wr-page-simple-plans-scripts/com.atlassian.jpo:jpo-wr-page-simple-plans-scripts.js:5:1331086) at Oi (https://linux-31012.prod.atl-cd.net/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/zdizrv/820015/1dlckms/8.20.15/_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:63:62954) at ki (https://linux-31012.prod.atl-cd.net/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/zdizrv/820015/1dlckms/8.20.15/_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:63:62749) at zi (https://linux-31012.prod.atl-cd.net/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/zdizrv/820015/1dlckms/8.20.15/_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:63:66587) at La (https://linux-31012.prod.atl-cd.net/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/zdizrv/820015/1dlckms/8.20.15/_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:63:90412)
Root Cause of the bug
Basically, what happens is this:
- when loading a plan, the following happens:
- all the issue types available in the issue type scheme(s) associated to the project(s) configured in the plan source are loaded
- the settings from each plan view are also loaded, including the Colour by setting
- when clicking on View Settings, the following happens:
- Jira tries to display the current view setting by loading all the colour/issue type mappings
- if the colour/issue type mapping has a reference to an issue type that was not loaded, the page will be blank due to the error "TypeError: Cannot read properties of undefined (reading 'name')"
Workaround
Workaround 1
Create a new plan. With new plans, the Colour by setting is empty by default, therefore the error will not occur and the View Settings page will load.
Workaround 2
This workaroud is trickier, because you will need to identify which issue type is missing, and then:
- either add the missing issue type to the issue type scheme associated to the project coming from the plan source
- or find a project that contains the missing type, and change the plan source to use that project indeed as the source
Fore more details about these workarounds, you can also refer to the KB article linked below:
https://confluence.atlassian.com/jirakb/the-view-settings-page-of-a-roadmap-plan-is-blank-due-to-an-invalid-colour-by-configuration-1206552897.html