Creating Asset object via REST API fails with error

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Creating an Asset object via REST API with Date and Time attribute fails with the below error:

1 2022-04-05T20:59:32.000+0200 is not valid (DateTime)for ISO8601 date 2022-04-05T20:59:32.000+0200 as input.

Environment

  • The issue is expected to occur in any Server/Data center installation of JIRA.

Diagnosis

The precise template for using Date and Time attribute via Rest API is shown below.

(Auto-migrated image: description temporarily unavailable)

Date and Time format should be in ISO Extended format to create an object via Rest API. In ISO 8601, date and time are connected by "T" and written. The time zone is expressed as "+09:00" as the difference time from UTC, and in the case of UTC, it is expressed as "Z".

Separate seconds and milliseconds with a comma (,) or dot (.). DenCode omits milliseconds when milliseconds are 000. ISO 8601 comes in several formats. For example, converting January 23, 2000, 1:23:45.678 (JST; +09:00) to ISO 8601 results in the following:

Format

Conversion result

Basic format

20000123T012345.678+0900

Extended format

2000-01-23T01:23:45.678+09:00

While creating the Asset object via REST API, use the date and time in Extended Format. Alternatively, If the time is in UTC, add a Z directly after the time without a space. Z is the zone designator for the zero UTC offset.

Cause

Date and time template used for creating asset objects doesn't match with the ISO 8601 Extended format.

Solution

Use the ISO 8601 extended format to create asset objects via Rest API.

In this case, the correct format is:

2022-04-05T20:59:32.000+02:00

Alternatively, If the time is in UTC, add a Z directly after the time without a space. Z is the zone designator for the zero UTC offset.

For Example:

2022-04-05T20:59:32.000Z

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.