Accessing Jira Agile Board Configuration throws Exception: Uncaught TypeError: Cannot read property 'regionKey' of undefined
Problem
Accessing Jira Agile Board Configuration throws
Exception: Uncaught TypeError: Cannot read property 'regionKey' of undefined
Diagnosis
The stack trace shows
TypeError: Cannot read property 'regionKey' of undefined
at Object.GH.WorkingDaysConfig.getRegionKeyForTimeZoneId
at Object.GH.WorkingDaysConfig.renderTimeZoneConfig
at Object.GH.WorkingDaysConfig.renderTab
at Object.GH.WorkingDaysConfig.init
Cause
This is related to Working Days board configuration. In table AO_60DB71_WORKINGDAYS
, you can find that the affected board has timezone set to the timezone that does not exist in Jira by default, for example Africa/Addis_Ababa
Resolution
Fixing via REST API
REST endpoint:
/rest/greenhopper/1.0/rapidviewconfig/workingdays/timezone
With example data input:
{"rapidViewId":2,"timeZoneId":"Europe/Brussels"}
- Example using
curl
: -
curl -D- -u admin:admin --data '{"rapidViewId":2,"timeZoneId":"Europe/Brussels"}' -X PUT -H "Content-Type: application/json" http://localhost:8080/rest/greenhopper/1.0/rapidviewconfig/workingdays/timezone
Fixing via Database SQL
- Shutdown Jira
Identify the non default timezone that have been configured here
select * from "AO_60DB71_WORKINGDAYS";
Alternatively, verify the timezone configured for the affected board exists in Jira by identifying the board id
select "TIMEZONE" from "AO_60DB71_WORKINGDAYS" where "RAPID_VIEW_ID" = <board_id>;
board_id
can be found in the browser URL. Eg: http://localhost:8080/secure/RapidView.jspa?rapidView=4038Change the timezone to a default timezone using the following query. Replace xxxx accordingly with the non-default timezone
UPDATE "AO_60DB71_WORKINGDAYS" SET "TIMEZONE" = 'defaultTimeZoneId' WHERE "TIMEZONE" = 'xxxxxx';
- Restart Jira
Remember to generate backup before modifying anything in the database.