We have defined a few date fields in JPD:
I want to use automations to populate the Original target date with a copy from the Project target date field when those are populated the first time with a quarter/month/day value.
I have the following steps in an automation rule (named: Copy the first Project target date to Original target date):
When I've hardcoded the date values it populates the Original target date field correctly:
{
"fields": {
"customfield_11819":
"{\"start\":\"2026-10-01\",\"end\":\"2026-12-31\"}"
}
}However if I try to use smart values it fails, example below:
{
"fields": {
"customfield_11819":
"{\"start\":\"{{issue.customfield_11444.start}}\",\"end\":\"{{issue.customfield_11444.end}}\"}"
}
}
Error from audit log: (no valid interval: {"start":"","end":""})I'm getting tired of Copilot and ChatGPT confidently saying they understand the problem and suggesting something that then doesn't work.
Now I turn to the kindness of my fellow JPD travelers...
What is the correct date-formatting-qualifier to use for extracting the start- and end-date from a custom date field and populate them in another custom date field in JPD?
Hi @Wim-Jan Lam -- Welcome to the Atlassian Community!
As you observed, Jira Product Discovery (JPD) uses its own date field format: it is a text representation of JSON, allowing it to store a single date, a date range, or a date-quarter.
But...rules do not recognize it as JSON for dot-notation access until it is parsed, such as with the jsonStringToObject() function.
You may use that function to access your first field to set the other:
{{jsonStringToObject(issue.customfield_11444).start}}
and
{{jsonStringToObject(issue.customfield_11444).end}}
As the values are identical layouts, you could also try just setting it directly:
{
"fields": {
"customfield_11819": "{{issue.customfield_11444}}"
}
}
And, when you need to use them as actual date types (e.g., when using other date functions), you may convert the value with the toDate function:
{{jsonStringToObject(issue.customfield_11444).start.toDate}}
Kind regards,
Bill
That is an excellent answer! In hindsight I was so close when I tried the following:
{
"fields": {
"customfield_11819": "{{customfield_11444}}",
}
}And missed to add issue. to customfield_11444.
Thanks for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And for my next step I'm going to use the first half of your answer!
Where I'll try and figure out how to calculate delay in weeks by extracting only the end dates from the two fields and calculating the difference in weeks.
So thanks again for taking the time and providing an answer beyond just: here's the solution to your question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.