Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automated Date Population

Travis Hill
Contributor
June 10, 2025

Have an interesting question on a rule that I have not started building just yet that I was hoping to get guidance from yall on.

So right now we have Features in Jira, as child tickets teams also create Epics that are linked to that Feature via a parent field.

The epics are required to have target start / target end dates to roughly gauge when work may finish (or assess delays).

A Feature may have 5-10 child Epics linked up to it all with varying Target start / target end dates. Essentially we would like to 'scan' these dates whenever there is an update and then add the latest date to the Feature level.

For example:

  • Feature A - No Target End
    • Epic 1 - Target End 6/30/25
    • Epic 2 - Target End 8/30/25
    • Epic 3  - Target End 9/30/25
    • Epic 4 - No Target End added

The automation should scan those dates and put 9/30/25 into the Target End field on the Feature level.

I assume I need to create a variable that stores all the target ends of the child tickets ,which I can do (because yall have helped with this in the past), what I dont know how to do is to only take the one target end (the one furthest out) to place at the feature level. Any thoughts? Thanks in advance!

1 answer

0 votes
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.
June 10, 2025

Hi @Travis Hill 

Without seeing your actual rule...

Perhaps try using the Lookup Issues / Work Items action with JQL to gather the children, and then use the min (or max) list functions with the date fields:

 

Kind regards,
Bill

Travis Hill
Contributor
June 10, 2025

That is an excellent recommendation. Let me try it out and get back to you if we run into issues.

Like Bill Sheboy likes this
Travis Hill
Contributor
June 12, 2025

 

@Bill Sheboy looks like its erroring out on the very last step: 

Screenshot 2025-06-12 at 2.41.41 PM.png

 

When I try to edit the target end:

Screenshot 2025-06-12 at 2.42.54 PM.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.
June 12, 2025

That expression is not correct.  An example to set that field could be:

  • trigger: some trigger, returning the Epic
  • action: lookup work items, with JQL to return the children of the Epic
  • smart values condition:
    • first value: {{lookupIssues.size|0}}
    • condition: greater than
    • second value: 0
  • action: edit work item 
    • the value you want would be below; please substitute the custom field ID for your field for the 12345 value
{
"fields": {
"customfield_10023": "{{lookupIssues.customfield_12345.max.jiraDate}}"
}
}

 

Please adjust the rule accordingly if the trigger work item is not the Epic.

Travis Hill
Contributor
June 12, 2025

Unfortunately, seems like im still getting the same error.

Screenshot 2025-06-12 at 5.03.48 PM.png

Screenshot 2025-06-12 at 5.03.57 PM.png

Screenshot 2025-06-12 at 5.04.06 PM.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.
June 12, 2025

Please show images of your complete Edit Work Item action and of the audit log details for the rule execution (with the areas at the right side expanded). 

I also recommend writing that entire JSON expression to the audit log before the edit to confirm it contains what you expect when the rule runs.

Thanks!

Travis Hill
Contributor
June 13, 2025

Looks like I need to rework it. Its not pulling in what I want in the logs. I will get back to you on this one!

Like Bill Sheboy likes this
Travis Hill
Contributor
July 15, 2025

@Bill Sheboy finally had some time to get back to this. I was able to get it to log the dates finally but Im getting a formatting error when I try to populate the max date into the parent ticket

Screenshot 2025-07-15 at 4.41.34 PM.pngScreenshot 2025-07-15 at 4.41.45 PM.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.
July 15, 2025

Hi @Travis Hill 

Please post images of:

  • your current, complete rule in one image, and
  • the complete Edit Work Item action. 

 

And just to confirm, that is the built-in Target End date, correct?

If so, I believe the value is provided to rules as a text representation of the date, and so it needs to be converted to an actual date before the max function is used, and then converted back to text for the JSON:

{{lookupIssues.customfield_10023.toDate.max.jiraDate}}

I recommend writing that value to the audit log to confirm it works as expected.

 

Travis Hill
Contributor
July 16, 2025

Audit-log-Automation-Roadmap-Jira.pngRule-builder-Automation-Roadmap-Jira.png

@Bill Sheboy hope this helps! Thank you.

Like Bill Sheboy 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.
July 16, 2025

Thanks for that information, please try the expression I suggested with the conversion before the max function:

{{lookupIssues.customfield_10023.toDate.max.jiraDate}}

 

And, some FYIs:

  • When writing values to the audit log, consider adding some reminder text as that will help identify what is being logged...particularly when the value is empty.  For example:
    • here is the max date from the lookup results: {{lookupIssues.customfield_10023.toDate.max.jiraDate}}
  • When using date formatting such as jiraDate, that produces a text value.  And so when you add the format() function after that it will not work.

 

Travis Hill
Contributor
July 16, 2025

Hey @Bill Sheboy this worked like a charm. Youre an absolute genius thank you.

I have one use case that maybe you could help with but itll be so inconsistent in occurrence that if we cant fix it, its fine.

So I tested it and added dates to 2-3 child tickets and the parent would always update with the last one in chronologically. However when I cleared all the child ticket dates out and there was nothing to log, it left the last date in the parent ticket. 

Is there a way to clear the field if the log retrieves nothing?

Suggest an answer

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

Atlassian Community Events