The JIRA REST API is not fully compliant with ISO 8601, so requires two changes to the format:
- Time zone offsets in the form
[+-]hhmm
instead of the ISO format,[+-]hh:mm
. - Fractional seconds, even if that fraction is 0 (e.g.
2023-06-25T20:32:13+0000
is not accepted while2023-06-25T20:32:13.00+0000
is accepted).
Below is a Python code example to convert ISO 8601 format to the format accepted by JIRA:
import datetime
planned_finish_date = (datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(hours=5)).isoformat(sep='T', timespec='seconds')
planned_finish_date = planned_finish_date.rsplit("+", 1)[0] + ".00+" + planned_finish_date.rsplit("+", 1)[1].replace(":", "")