Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Populating JPD date field using Automation

Mari-Ann Eriksen
Contributor
April 8, 2024

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""}"
}
}


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...

 

2 answers

1 accepted

1 vote
Answer accepted
Nick Haller
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 8, 2024

Hi @Mari-Ann Eriksen ,

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\"}"
}
}
Mari-Ann Eriksen
Contributor
April 9, 2024

Thank you! This update did not fail, so now I can at least get the field populated 

Mari-Ann Eriksen
Contributor
April 9, 2024

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! 

Like # people like this
Thierry BLOCH
Contributor
May 27, 2024

Hello

And with today's date:

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

Louise Baker
Contributor
July 29, 2024

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 '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

Thierry BLOCH
Contributor
August 26, 2024

Hi Louise

Maybe check your date format?

0 votes
Rohan Swami
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 8, 2024

Hi @Mari-Ann Eriksen would the feature described in this Community Post solve your problem if Reported date was one of the supported fields? Are you using a Company-managed project or a Team-managed project?

Mari-Ann Eriksen
Contributor
April 9, 2024

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events