Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hello,
I'm trying to setup an automation that will copy values from Target Start and Target End to a linked issue. I have the automation set up and can get the cloned issue updating, but I am having trouble with the Target Start / End fields that are created by Advanced Roadmaps.
I have the 'Edit issue' action running on linked issues, and am using the Additional Fields to set these values. If I use the following, the dates are copied but are one day behind the trigger issue.
{
"fields": {
"Target start": "{{triggerissue.Target start}}",
"Target end": "{{triggerissue.Target end}}"
}
}
If I try to work around this by using .plusdays(1) (as in below) then I get 'Error parsing date string'.
{
"fields": {
"Target start": "{{triggerissue.Target start.plusDays(1)}}",
"Target end": "{{triggerissue.Target end.plusDays(1)}}"
}
}
Where am I going wrong here?
This morning I have found a solution for this problem. When using the Clone Issue (or create/edit) function in Automation for Jira, setting the following under additional fields will clone the Target Start or Target End values and can handle date manipulation.
Replace customfield_12345 with the id of your Target Start or Target End field.
{
"fields": {
"customfield_12345": "{{issue.fields.customfield_12345.toDate("yyyy-MM-dd").plusDays(1).format("yyyy-MM-dd")}}"
}
}
Sounds like a good solution!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Steven Drury I am having the same issues you had, not letting the target start start/end date be formatted with yyyy-MM-dd format. I am following what you posted but am still not getting it. Is there any way you could post your full JSON script so I can see what im doing wrong?
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.
I did not @Justin Kix . Are you running into the same problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Steven Drury , this is working for me but when I try to pass smart value variable to plusDays function it is not working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Chaya
Created Variables are text but the function plusDays() is expecting a number parameter.
Please convert that using asNumber. Assuming your variable is named "days" that would parameter would be:
days.asNumber
By the way...I recommend using a naming convention with variablesto avoid the possibility of collision with built-in smart values. For example, renaming "days" to "varDays".
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Simmo - This is the second time in a couple of weeks where people are having trouble in Automation with the Target Date. It "seems" to be a typical date field type, but it doesn't behave as one when using Automation. Thoughts?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey guys,
According to this Code Barrel ticket, the Portfolio and Advanced Roadmap fields are not supported yet:
https://codebarrel.atlassian.net/browse/AUT-1370
@Steven Drury To learn which fields are in the JSON, and so potentially have smart values, please see this how-to article to use the REST API to grab an example issue for investigation:
https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Bill Sheboy and @John
Glad I'm not the only one having an issue. I'm guessing it will eventually fall into support, but for now it's in limbo. The dates do have JSON fields available and can render as smart values, but any attempt to use the date functions to manipulate the fields or render as a different format fails (most functions under this link)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @John Funk & @Steven Drury ,
I'm not familiar with Advanced Roadmaps but it sounds like they could be in a format / form that we don't understand.
What I'd suggest you try is visiting https://support.atlassian.com/jira-software-cloud/docs/use-smart-values-to-manipulate-and-format-dates/ and seeing if you can use the toDate smart value then the plusDays and see if that helps?
Cheers,
Simeon.
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.