Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-24869

Having invalidly formatted dates cause Plan to throw exceptions on formatDateUTC

XMLWordPrintable

      Issue Summary

      Having invalidly formatted dates cause Advanced Roadmaps for Jira (ARJ) Plan to throw exceptions/errors on formatDateUTC

      Steps to Reproduce

      1. Create an issue;
      2. Let ARJ schedule the issue;
      3. Modify the Target Start and/or Target End dates manually to an invalid value
        • (i.e. add non-numbers to it);
      4. Attempt to load the plan while showing Target Dates;

      Expected Results

      • ARJ warns the user that the invalid date;
      • Plan loads with warnings

      Actual Results

      The below exception is thrown in a JavaScript exception:

      Client Information
      User Agent: Mozilla/5.0 \(X11; Ubuntu; Linux x86_64; rv:69.0\) Gecko/20100101 Firefox/69.0
      
      Plugin Information
      Version: 3.x.x
      
      System Information
      Jira Title: JIRA Appliance
      Jira Version: x.x.x
      
      Stack Trace
      Error: Date passed to formatDateUTC function is not valid
      
      s@https://<redacted>/s/d41d8cd98f00b204e9800998ecf8427e-CDN/wojjth/803005/bda17d3ad5dce8338fe2ac16d0335713/3.12.0/\_/download/batch/com.atlassian.jpo:jpo-wr-page-common-frontend-scripts/com.atlassian.jpo:jpo-wr-page-common-frontend-scripts.js:29:53216
      value@https://<redacted>/s/d41d8cd98f00b204e9800998ecf8427e-CDN/wojjth/803005/bda17d3ad5dce8338fe2ac16d0335713/3.12.0/\_/download/batch/com.atlassian.jpo:jpo-wr-page-simple-plans-scripts/com.atlassian.jpo:jpo-wr-page-simple-plans-scripts.js:3:1064137
      Ri@https://<redacted>/s/d41d8cd98f00b204e9800998ecf8427e-CDN/wojjth/803005/bda17d3ad5dce8338fe2ac16d0335713/3.12.0/\_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:42:61517
      Oi@https://<redacted>/s/d41d8cd98f00b204e9800998ecf8427e-CDN/wojjth/803005/bda17d3ad5dce8338fe2ac16d0335713/3.12.0/\_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:42:61312
      Mi@https://<redacted>/s/d41d8cd98f00b204e9800998ecf8427e-CDN/wojjth/803005/bda17d3ad5dce8338fe2ac16d0335713/3.12.0/\_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:42:65146
      Ba@https://<redacted>/s/d41d8cd98f00b204e9800998ecf8427e-CDN/wojjth/803005/bda17d3ad5dce8338fe2ac16d0335713/3.12.0/\_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:42:84649
      Ga@https://<redacted>/s/d41d8cd98f00b204e9800998ecf8427e-CDN/wojjth/803005/bda17d3ad5dce8338fe2ac16d0335713/3.12.0/\_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:42:85033
      ks@https://<redacted>/s/d41d8cd98f00b204e9800998ecf8427e-CDN/wojjth/803005/bda17d3ad5dce8338fe2ac16d0335713/3.12.0/\_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:42:91570
      Ts@https://<redacted>/s/d41d8cd98f00b204e9800998ecf8427e-CDN/wojjth/803005/bda17d3ad5dce8338fe2ac16d0335713/3.12.0/\_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:42:90950
      Ps@https://<redacted>/s/d41d8cd98f00b204e9800998ecf8427e-CDN/wojjth/803005/bda17d3ad5dce8338fe2ac16d0335713/3.12.0/\_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:42:97362
      Lt@https://<redacted>/s/d41d8cd98f00b204e9800998ecf8427e-CDN/wojjth/803005/bda17d3ad5dce8338fe2ac16d0335713/3.12.0/\_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:42:10257
      On@https://<redacted>/s/d41d8cd98f00b204e9800998ecf8427e-CDN/wojjth/803005/bda17d3ad5dce8338fe2ac16d0335713/3.12.0/\_/download/batch/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts/com.atlassian.jpo:jpo-wr-page-portfolio-frontend-vendor-scripts.js:42:30695
      

      Workaround

      Modify the invalid dates from the plan and format them in a way that Portfolio can parse it properly.

      This is known to affect:

      • Target dates;
      • Release dates;
      • Dependency dates;
      • Date fields that can be added to the roadmap;

      Run the SQL query in the database to validate the invalid Date field value:

      SELECT cf.id as CF_ID, concat(P.pkey,'-',I.issuenum) as ISSUE, cfv.id as "custom field value id", customfieldtypekey, cfname, cfv.datevalue
      FROM customfield cf, customfieldvalue cfv
       join jiraissue I on I.id = cfv.issue
       join project P on P.id = I.project
      where cf.id = cfv.customfield
      and customfieldtypekey like '%date%'
      and cfname = '<CustomFieldName>';

       Replace "<CustomFieldName>" with the actual Date Picker custom field name.

      Look for the invalid date from cfv.datevalue column (eg: '0020-06-02 00:00:00'):

      "10800";"TEST-123";"3036304";"com.atlassian.jira.plugin.system.customfieldtypes:datepicker";"Start Date";"0020-06-02 00:00:00"
      

      Edit the date value from the edit issue screen to fix the date data. If you find more than one, you can use bulk edit operation to fix multiple issues.

              Unassigned Unassigned
              resteves Rodrigo Heinzen
              Votes:
              9 Vote for this issue
              Watchers:
              16 Start watching this issue

                Created:
                Updated: