Issue with date field when trying to create new version via REST API

Alex Cooke September 16, 2019

Hi all,

 

I am trying to automate versions in JIRA via the REST API, in a bash script as a part of our pipeline, but for some reason the requests keep failing on the releaseDate and userReleaseDate. releaseDate returns "Error parsing date string" and for some strange reason userReleaseDate doesnt like the format given in the documentation.

 

Does anyone know how to resolve this?

 

Thanks,

Alex

 

P.S.

$

releaseDate=`date +%Y/%m/%d`
stringify=$releaseDate

["Unable to unmarshal (to type [simple type, class java.lang.String]): Error parsing date string: {{$releaseDate}} (through ref
erence chain: com.atlassian.jira.rest.v2.issue.version.VersionBean[\"releaseDate\"])"]

 

userReleaseDate=`date +%d/%b/%y`
stringify=$userReleaseDate

{"errorMessages":[],"errors":{"releaseDate":"Please enter the date in the following format: d/MMM/yy"}}

 

-d '{ 

"description": "{{jiraDescription}}",

"name": "{{$jiraName}}",

"archived": false, "

released": false,

"userReleaseDate": "{{$userReleaseDate}}",

"project": "FOO",

"projectId": 1234}'

}'

2 answers

0 votes
jira guy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 16, 2019

The date input format is probably wrong.

Check the response from Atlassian here on a similar question

https://community.atlassian.com/t5/Jira-questions/Date-time-format-in-the-REST-API-giving-error-response-Operation/qaq-p/617999

0 votes
Rakesh Kumar September 16, 2019

Hi Alex, 

Could you please paste a sample of the date string you are passing in json body? 

 

Regards, 

Rakesh

Alex Cooke September 16, 2019

I was just thinking that as I posted the question. Added snippets of code.

Rakesh Kumar September 17, 2019

 

Hi Alex,

 

Please use the format for releaseDate same as you have used for userReleaseDate as this is the correct format seems to me.

releaseDate=`date +%d/%b/%y`
stringify=$releaseDate

 

Regards,

Rakesh

Suggest an answer

Log in or Sign up to answer