How to automate a custom start and end date field into the Start and Due date

John Conneely May 16, 2024

Hi,

I have 2 sets of start/end date fields. Target Start/end and Actual Start/end

I'd like to copy the Target start/end custom fields into the Start /due date fields in jira, unless there is a value in Actual Start

Rule runs when any of  target/actual start/end date fields are edited

Let me know if I should be doing one automation per field too. 

Branch 1 - For when Target start is changed
Actual Start is blank
And Target start != Start date
input it into the Start date (field used by the backlog timeline functionality)

Branch 2 - If Actual Start is populated
And Actual Start != Start date
input it into the Start date (field used by the backlog timeline functionality)

Branch 3 - For when Target end is changed
And Actual End is blank
And Target end != Due Date
input it into the Due Date (field used by the backlog timeline functionality)

Branch 2 - If Actual End is populated
And Actual End != Due Date
input it into the Due Date (field used by the backlog timeline functionality)

Target start = customfield_13328 and Target end = customfield_13329, Actual start = customfield_14936


I've tried a few different things, converting to datetime, changing to custom fields etc. and I get this error with the below automation, when I edit target end
automation screenshot.png

Error editing issues: (The duedate must be a string (duedate)).

Happy to hear alternatives to advanced too.

The above screenshot is missing the edit steps for the rest, but I'm assuming they will work similar, so thats why I haven't added til I fix it. 

2 answers

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2024

Hi @John Conneely -- Welcome to the Atlassian Community!

Adding to Walter's suggestions...

Those are the advanced roadmap fields in the updates.  To use them please try the custom field id and advanced edit with JSON is required as they are not yet in the field dropdown lists for edits: https://jira.atlassian.com/browse/AUTO-1263

In rules, they are apparently text type and must be converted to dates prior use:

{{issue.customfield_13329.toDate.format("yyyy-MM-dd")}}

Kind regards,
Bill

1 vote
Walter Buggenhout
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2024

Hi @John Conneely and welcome to the Community!

From your screenshot, it seems you are trying to update the due date field twice in the same attempt: once by copying it from the current issue and once more using advanced settings. As you are already copying the due date field from, it should no longer be necessary to add the advanced json as well, so I would recommend just getting rid of that part for starters.

Hope this helps!

John Conneely May 16, 2024

Hey Walter,

Thanks for the response! 

Good spot, probably a remainder from my other attempts. Tried removing the copy part, as I don't see my target end field in the copy options. automation screenshot2.png

Still getting the same string error for this config

Here's screenshot of me trying to find my date field:

image.png

Like Hamza El filali likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 16, 2024

Hi @John Conneely -- Welcome to the Atlassian Community!

Adding to Walter's suggestions...

Are those the advanced roadmap fields you are updating?  If so, using the custom field id and advanced edit with JSON is required as they are not yet in the field dropdown lists for edits: https://jira.atlassian.com/browse/AUTO-1263

Next, you do not show your complete rule, and your question implies you want to make changes when the fields change.  Does the trigger cover changes to any of the fields impacted?

Kind regards,
Bill

John Conneely May 16, 2024

No they are just regular custom date fields (lowercase s/e in the start/end)

The roadmaps fields were date/time so I thought were more complicated to transfer to the due date

For simplicity, I just removed all the previous steps to make sure. Same error unfortunately

 

image.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 16, 2024

If your custom field is a date type, the JSON should look like this for Due Date:

{
"fields" : {
"duedate" : "{{issue.customfield_13329.jiraDate}}"
}
}

The value attribute is used with single and multiple-select fields.

John Conneely May 17, 2024

@Bill Sheboy Progress! I think...

image.png

Tried a couple of things here then from: https://community.atlassian.com/t5/Jira-questions/Automate-setting-of-Due-Date-based-on-assigned-Fixed-Version/qaq-p/2021332

"duedate" : "{{issue.customfield_13329.jiraDate.format("yyyy-MM-dd")}}"

and

"duedate" : "{{issue.customfield_13329.format("yyyy-MM-dd")}}"

But both getting the error in the screenshot

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 17, 2024

I suspect that field is text representing a date, and not a date type field.  You may check that using this instead to first convert the value to a date:

{{issue.customfield_13329.toDate.format("yyyy-MM-dd")}}

Like John Conneely likes this
John Conneely May 20, 2024

Amazing @Bill Sheboy ! That did the trick!

Can you suggest that as an answer so I can upvote it?

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events