I am attempting to insert work logs into JIRA using the REST API from my NodeJS backend. I am able to get it to work successfully from my local environment but when I deploy (to a dockerized managed service provider that I don't have a TON of control over), the entries are rejected by JIRA with the following error:
started:
Invalid date format. Please enter the date in the format "yyyy-MM-dd'T'HH:mm:ss.SSSZ".
I have attempted no less than 15 variations on my approach here at this point and none of them will work on the deployed server.
The code I am using to format the date successfully when I run locally utilized the date-fns library:
started: format(parseISO(entryStartTime), "yyyy-MM-dd'T'HH:mm:ss.SSSXX")
I have also attempted other approaches using other formatting strings, and even tried switching to MomentJS to see if I would get a different outcome (I did not).
I logged what the date string looks like in both instances - does anyone have any idea what I might be doing wrong here?
Local - working
Time entry before format: 2021-07-14T13:00:12+00:00
Time entry after format: 2021-07-14T07:00:12.000-0600
Server - NOT working
Time entry before format: 2021-07-14T13:00:12+00:00
Time entry after format: 2021-07-14T13:00:12.000Z
new Date(entryStartTime).toISOString().