Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to set Date via API

Gary.Smith
Contributor
August 5, 2021

I've gone through a 100 posts about date but can't work this out. 

When i GET from the API the date is in format 2021-12-01 but it doesn't accept it when using POST.

Anyone know what format it should be in? It's a date field not datetime

1 answer

0 votes
Mohamed Benziane
Community Champion
August 5, 2021

Hi,

As noted in the documentation, for a Date picker custom field this should be something like that:

"customfield_11441" : "2015-11-18"

For a date system field 

"duedate" : "2015-11-18"

Can you share your code please and the error message.

Gary.Smith
Contributor
August 5, 2021

It was late and I am dumb.. I forgot to convert it to string.

 


$Get-Date $($LeaseInfo.'Start Date'-Format 'yyyy-MM-dd' ).ToString()

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events