Hey buddies!
I need help sorting out setting the due date of a new issue created by an automation triggered by another's status change.
At the moment, I set the Due date in the automation's Then block that creates the issue and have this for the date: {{customfield_12345.jiraDate}} and is succeeds, but the due date doesn't have anything in it.
Digging deeper (API query against Project A JPD trigger issue, I see that the 'source' date field schema looks like this:
{ "type": "string", "custom": "jira.polaris:interval", "customId": 12345 }
and the created issue in Jira Project B's schema is:
{ "type": "date", "system": "duedate" }
How do I convert that "end" date in A which appears to be a string to a date in project B's issue?
Thanks!!!
OK, what ended up working, regardless of understanding why it's not doing what it should, is the following:
{{issue.customfield_12345.substring(29,39)}}
knowing the date is always structured as 4d-2d-2d then the substring location is always the same.
Pragmatism at its finest LOL
Thanks for the assists!
The issue you're facing is related to how Jira handles custom fields and the need to convert a string date (from a custom field in Project A) into a valid date format for the Due Date
field in Project B. Specifically, your custom field in Project A is using a JSON format, which is stored as a string, and the Due Date
field in Project B expects a proper date format.
Here's a breakdown of how you can resolve this:
{
"start": "2025-12-31",
"end": "2025-12-31"
}
yyyy-MM-dd
but within a JSON object. You are interested in the "end"
date, which you need to extract and convert to a valid Jira date."end"
field directly using smart values and then convert it into a Jira-compatible date.end
date from the custom field, use:{{customfield_12345.end}}
"end"
date as a string, you can convert it to a Jira-compatible date format. Fortunately, Jira Automation supports date conversion using .jiraDate
or .toDate
..toDate
function to convert the string into a date that Jira can understand:{{customfield_12345.end.toDate}}
Due Date
in Project B:end
date from Project A in the correct format, you can use it to set the Due Date
for the newly created issue in Project B.Due Date
field with this smart value:{{customfield_12345.end.toDate}}
cf[12345]
has a value.Due Date
, use the following smart value:{{customfield_12345.end.toDate}}
If it's still not working as expected, add a Log action before the issue creation to see what value is being returned:
Logging: {{customfield_12345.end}} and {{customfield_12345.end.toDate}}
This will help confirm that the date is being extracted and converted correctly before you use it in your automation.
{{customfield_12345.end.toDate}}
to convert the string date to a proper Jira date."end"
value directly and convert it using .toDate
before applying it to the Due Date
field in Project B.This approach should allow the automation to correctly set the Due Date
in Project B based on the date range stored in the custom field of Project A.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the well written solution, but I had already tried this and it didn't work. I don't think the text is being properly converted to JSON because I get nulls. More specifically, the result of the Logging line are:
"Logging: and "
Where I am making painful traction is on crafting a regex to parse the text string :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
To set the "end" date from a custom interval field in Project A as the due date in Project B:
Use the "end" value because the field in Project A is an interval containing both a start and an end date. The end date indicates the finish point of the interval, which is why it's needed.
Try to automatically convert this end date to the Jira date format with:
{{issue.customfield_12345.end.jiraDate}}
3. If this doesn’t work, explicitly format the date like this:
{{issue.customfield_12345.end.format("yyyy-MM-dd")}}
I hope this helps, if so, mark the answer as correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the suggestion, but this didn't work. I don't think the text string is being recognized as proper JSON... I can parse substrings to extract a date using regex but specifying start or end returns null.
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.