Populating JPD date field using Automation
Asked by Mari-Ann Eriksen:

I was cloning ideas from Jira software to Jira Product Discovery. Had a date field called Reported date, which I was unable to clone into Reported date in JPD - probably due to the different date format in JPD. So I created the date into a text field called ReportedDateM, so I had the information in JPD idea. My idea was to later update Reported date based on the date in ReportedDateM.

Manual updates was very tedious job as the calendar in JPD is not very good (it takes a lot of clicks to be able to select another year, for instance) and it is not possible to add keyboard inputs, or copy/paste in date (so needed to use the calendar). The ones with something in Reported date are the ones I have manually set with the calendar.

I have been trying to use Automation, but it fails at every attempt - I do not know how to write the JSON to make it work...  
Can someone please advice me if it is possible to update the JPD date field Reported date (my customfield_10034) with values from the text based field ReportedDateM, and if so, how?

If it is not possible to use date from the text field, is it possible to update the Reported date field to anything using automation (so I can set it initially to correct year 2021 etc, and won't have to click so much in the calendar)?  
I tried something like this:

```
{
"fields": {
"customfield_10034": "{""start"":""2021-04-01"",""end"":""2021-04-01""}"
}
}
```

<br />

![fields.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/316994i14EF274C55C4F8C3/image-size/large?v=v2&px=999 "fields.PNG")  

If I manage to solve this, the next step is to see if it is possible to populate Reported date on new ideas based on the created date in JPD...


Answers:
author: Nick H
body: Hi [@Mari-Ann Eriksen](/t5/user/viewprofilepage/user-id/5433955) ,

I believe you need to escape the quotations so it might be something like this:

```
{
"fields": {
"customfield_10034":"{\"start\":\"2021-04-01\",\"end\":\"2021-04-01\"}"
}
}
```

comments: author: Mari-Ann Eriksen
body: Thank you! This update did not fail, so now I can at least get the field populated


author: Mari-Ann Eriksen
body: In fact, having this correct JSON solved the whole problem. I was then able to fetch the data from the text field into the JPD date field

{  
"fields": {  
"customfield_10154":"{\\"start\\":\\"{{issue.customfield_10147}}\\",\\"end\\":\\"{{issue.customfield_10147}}\\"}"  
}  
}

Thanks for your help!


author: Thierry BLOCH
body: Hello

And with today's date:

{  
"fields": {  
"customfield_10154":"{\\"start\\":\\"{{now.format("yyyy-MM-dd")}}\\",\\"end\\":\\"{{now.format("yyyy-MM-dd")}}\\"}"  
}  
}


author: Louise Baker
body: Thank you for this! I am trying to use the JSON, but runnign into issues.  
My usecase is that I created a manual Date field. Whenever the status is updated, I want to record the time it was moved. Then, I can use this field later on to see which ideas have been in the same status for awhile.  
I am using [@Thierry BLOCH](/t5/user/viewprofilepage/user-id/4771334) 's json (of course subbing out my customfield ID for the ID that mine is) but I get an error. Any suggestions?![Screenshot 2024-07-29 at 2.29.27?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/338661i273E8D6814490E91/image-size/large?v=v2&px=999 "Screenshot 2024-07-29 at 2.29.27?PM.png")


author: Thierry BLOCH
body: Hi Louise

Maybe check your date format?


author: Rohan Swami
body: Hi [@Mari-Ann Eriksen](/t5/user/viewprofilepage/user-id/5433955) would the feature described in [this Community Post](https://community.atlassian.com/t5/Jira-Product-Discovery-articles/New-Jira-Integration-Autofill-dates-in-JPD-from-linked-delivery/ba-p/2618305) solve your problem if *Reported date* was one of the supported fields? Are you using a Company-managed project or a Team-managed project?

comments: author: Mari-Ann Eriksen
body: Hi, No, it would not solve the problem, as the Jira issue I am fetching the date from is the clone of the idea and not a delivery ticket. And I will remove the link (cloned by) once I have managed to get all data over to JDP.