Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira Automation: Parent issue due date based on children issues due date Edited

Hi guys,

I'd like to setup automation for my Epics' due dates based on the due dates of all issues inside these Epics.

I've found this thread and tried to repeat the same flow via Automation in Jira, but it doesn't work at all:
https://community.atlassian.com/t5/Jira-questions/Can-I-automatically-set-the-due-date-of-a-parent-issue-to-the/qaq-p/101813

What am I doing wrong?

 

Here in Documentation it's also mentioned, that I can use {{triggerIssue}} smart value, but everything stops working with it.
https://support.atlassian.com/jira-software-cloud/docs/smart-values-general/

Please, find a screenshot with my flow attached.

https://drive.google.com/file/d/1PcV_OGJ5rQw_pzNy4KKDjdHSUNW4yQ4P/view?usp=sharing

Also welcome for any other ideas how to setup that all.

Thanks.

 

2 answers

Hi Dmitry. You have some really good questions here.
_ _ _ _ _ _ _

The first thread you mentioned is a few years old. I contributed to it today, both updating it with new information (that might help you), and also to provide some additional warnings about the approach outlined there.
_ _ _ _ _ _ _

The {{triggerIssue}} smart value should work, I use it often. I didn't see a screenshot in your original post, so I'm not sure what problem you have when you try to use it.
_ _ _ _ _ _ _

Back to your overall question though, it is currently quite challenging to set the "Due Date" in an Epic based on the Due Date of child issues. In my opinion, it should be easier. But the features available in Jira Automation as of right now make it much harder than it should be.

A question for you: do you want the Epic Due Date to be based on just the Stories, or on the Stories and any Sub-tasks?

As I noted earlier, it's nearly trivial to keep the Due Date of a Story in sync with all the Sub-tasks for that Story.

However, keeping an Epic Due Date in sync with all its child Stories is pretty challenging.
_ _ _ _ _ _ _

Before I write more, I'll let you respond to what I've written so far.

Hi @Mykenna Cepek , thanks for your reply.

I've attached the screenshot link in my post above, I'll duplicate it here also:
https://drive.google.com/file/d/1PcV_OGJ5rQw_pzNy4KKDjdHSUNW4yQ4P/view?usp=sharing

Answering your question:
- A question for you: do you want the Epic Due Date to be based on just the Stories, or on the Stories and any Sub-tasks?
- Yes, I'd like Epic Due Date be based on all children Stories, Tasks and Sub-tasks.
I've got the same automation already set up for Epic Status based on all statuses of children issues within this Epic.
It consists of 2 automation flows:
one for Stories Status based on Sub-tasks/Sub-bugs statuses,
and the 2nd for Epics based on Stories/Tasks statuses.
Please, take a look at these screenshots:
For Epics: https://drive.google.com/file/d/1IraXhsTvM3aQ8PprITrSdiuV0ennJK7M/view?usp=sharing
For Stories/Tasks: https://drive.google.com/file/d/1XcWnKyDIeLEiQ3P9R3qvhDN3B-LZU8wN/view?usp=sharing
So, I assumed I could set up the same automation flow for Due Dates, but it seems that the condition with {{triggerIssue}} doesn't work.

@Mykenna Cepek

Well, I've found my first mistake.

- Related Issues Condition module has to be inside the Epic branch.

Here is a screenshot: 

https://drive.google.com/file/d/1hHjg59yQSf7XfoawFET_uCYffjC0ENYv/view?usp=sharing

But now I've got the next error:

JQL search failed for some issues. This is most likely because the JQL with smart-values was not valid for this query:"("cf[10008]" = SDJP-1 or (parent = SDJP-1 and issuetype in standardIssueTypes())) AND ('duedate' is EMPTY OR '2021-02-26' > 'duedate')" - Field '2021-02-26' does not exist or you do not have permission to view it.

Simply change your JQL from this:

{{triggerIssue.fields.duedate}}

To this:

{{triggerIssue.duedate}}

to eliminate that message. You don't need to use the .fields accessor in the smart value.

@Mykenna Cepek ,

I've already tried that and it didn't help, I received the same error message:

https://drive.google.com/file/d/1VbdM1sPWNYFd8Tk9ophGF8ZeLXPOPoKj/view?usp=sharing

I also just want to remind you that what you're trying to do is quite complicated. Unless you're willing to spend a lot of time figuring this out, you might want to re-evaluate the cost/benefit for this. As I mentioned earlier, it should be easier -- but currently it's not. Many known issues in automation will be in your way. Smarter people than me have tried and given up.

Have you looked at Roadmaps (aka Plans) at all? They automatically roll up the dates in child issues for you -- no automation needed. I realize it's a different approach and a different view. It also doesn't update the dates in the issues.

But if your goal is to eventually visualize the aggregate dates, that might be an easier way to get there.

Responding to:

I've already tried that and it didn't help, I received the same error message:

I suspect you still have quotes around the smart value.

Don't use this:

'{{triggerIssue.duedate}}'

Use this:

{{triggerIssue.duedate}}

Putting quotes around it will first substitute the smart value result (a date) and then the JQL will try to interpret that date as a Jira field. The quotes are the problem.

Well, I use "Plans" also for visualisation and for quick epics search, but it doesn't work in cases when a new issue is created and the due dates of parent issues have to be changed.

All of this had been working successfully for more than 1 year in BigPicture add-on, but now they have technical issues with Quick Filters, so I'd like to set up this via Jira Automation, and I believe that it's not so complicated as you say.

I just need to understand, why {{TriggerIssue.dudate}} returns the correct date, but gives the error message "Field '2021-02-26' does not exist or you do not have permission to view it."

When we understand that, the problem will be solved.

I've also tried without quotes, and it didn't help.

It returns the same response:

"("cf[10008]" = SDJP-1 or (parent = SDJP-1 and issuetype in standardIssueTypes())) AND ('duedate' is EMPTY OR 2021-03-02 > 'duedate')" - Field '2021-03-02' does not exist or you do not have permission to view it.

Wow. I wouldn't have believed it. But I just discovered that a plain JQL-based issue search (completely outside of automation) will fail on this:

2021-03-02 > duedate

but will succeed on this:

duedate < 2021-03-02

So just reverse the operands in your comparison (and invert the compare operator), and see if that works.

The rule config you have in the last screenshot looks correct from a syntax POV, but not sure if the logic is 100% correct at the moment, the "Related issues" conditions will only match true if *all the stories in the Epic* either don't have a due date, or the due date is < than the triggering issue. Is this the logic that you want? Or just that the Epic's due date is null or less that the triggering issue? If so you don't need to use the related issue condition and should us the JQL condition instead.

If the logic _is_ that the condition needs to match for all stories within the Epic, you'd still need to exclude the current issue (since the current issue is still part of the same Epic). You could get around this by changing the logic to be <= rather than < (which will evaluate false, since you're trying to compare to itself)

Hello @Dmitry Nekrasov

Please let me update you on Big Picture problems with JQL filters. We have already completed work on fixing the bug, and its current status is “Waiting for the release.”
We plan to release the bugfix version in the first week of February.
If you have further questions, I will gladly answer them.

Best,
Anna/SoftwarePlant

Several concerns for you to ponder and maybe address, based on what I see here...

  • As written, this rule will trigger for a "Due date" field change for any issue in any project. That's probably excessive, especially when I see the first conditional focusing in on just one project. Just want to ensure you understand that the trigger applies to all issues in the entire Jira instance that change based on the trigger settings -- moderated only by the projects that the rule might be set to under "Rule details".
  • Your second conditional combines Issue Types at two different levels of the Jira hierarchy: Story/Task/Bug (all at the "story level") and Sub-task/Sub-bug (at the "sub-task level"). It's important to realize that the parent relationships are different at different levels. For example:
    • issue.parent only works when the issue is at the "sub-task level", allowing you to go from a Sub-task to its parent Story.
    • You need to use issue.epic instead when the issue is at the "story level", and you want to go from a Story to its Epic.
  • The first two conditionals after the trigger act as filters, terminating the rule early when a condition fails for the triggered issue. Note those conditionals do not impact later JQL in the rule. So as written, your "Related issues condition" could access issues outside the SDJP project. Example: the triggered issue is an Epic in the SDJP project, but that epic has stories from other projects.

One reason you might see no action being taken, for example, is that the triggered issue was at the "sub-task level", and so the "For epic (parent)" branch won't do anything (because the parent of a Sub-task is a Story, not an Epic).

Adding some "Audit log" debugging can help you understand what's working and not working as you expect. I outlined some examples recently in this other post:

https://community.atlassian.com/t5/Jira-Software-questions/Automation-order-of-operations/qaq-p/1593672

1. The filter for project is just for the test period. After I setup all correct, I'll delete it.

2. The second condition also works correctly. When I delete the 3d condition, all automation works fine.

3. All issues are inside the single SDJP project.

4. I make tests with Story level changing it's due date. Also, as I mentioned above, when I use the same flow for Statuses - everything works.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
Community showcase
Published in Jira

Announcing the waitlist for Jira Work Management

Hey there Cloud Community members! We’re excited to give you the first glimpse of the new home for business teams on Jira — Jira Work Management. Jira Work Management is the next generation of J...

750 views 12 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you