It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

Hi Alex, 

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

 

Regards, 

Rakesh

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

 

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

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

865 views 6 24
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you