Forums

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

copying dates

Anita Pallas February 6, 2024

Hello

 

I need an automation that does the following:

  1. if there are linked issues (there could be multiple linked issues)
    1. work out the earliest start date and copy that to the trigger issue
    2. work out the latest due date and copy that to the trigger issue
  2. add any linked issues from trigger issue to parent issue
  3. work out the earliest start date of all child issues and copy that to the parent issue
  4. work out the latest due date of all child issues and copy that to the parent issue

 

Also, is there a way to move linked issues to the top of an issue screen?

 

Thank you for your help.

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
February 7, 2024

Hello @Anita Pallas 

Have you tried to construct Automation rules for this? If so, show us what you have. If you have not yet tried, I suggest that you do try and then ask questions when you get stuck.

What event (or events) do you want to trigger this automation rule?

In step 2 you mention "linking" the linked issues of the trigger issue to the trigger issue's parent.

Then in step 3 and 4 you talk about getting the dates of the "child" issues and setting the dates of the parent issue. 

"Child" issue and "linked" issue are not necessarily the same thing. Can you clarify these references? Are you truly trying to look at linked issues in steps 1 and 2, and separately looking at child issues in steps 3 and 4?

A standard level issue (i.e. Task, Story, Bug) can have child issues (sub-tasks) and linked issues.

An Epic can have child issues and it can have linked issues.

 

Given that you are working in a Premium subscription there can be additional hierarchy levels above Epic such that Epics are children of other issues types.

How many layers of the hierarchy are you trying to affect with the automation?

 

Anita Pallas February 7, 2024

Hello @Trudy Claspill 

Thanks for responding.

So far all I have working is this which is for to add the children of an epics start date to the epic.

It fails every time when I change the "start date does not equal" to "start date is before". So I am now stuck with this part.

Screenshot 2024-02-08 161351.png

Trudy Claspill
Community Champion
February 7, 2024

You said the rule fails when you change the condition. What are the details on the rule execution Audit Log in that case? And what is the actual value of the Star date in the parent issue and in the trigger issue in that case?

Anita Pallas February 7, 2024

The first part of it is the same just with linked issues like below:

Screenshot 2024-02-08 162217.png

Anita Pallas February 7, 2024

@Trudy Claspill maybe I used the wrong word there, it doesn't fail it just doesn't perform any actionsScreenshot 2024-02-08 162331.pngScreenshot 2024-02-08 162408.png

Trudy Claspill
Community Champion
February 7, 2024

So you didn't change the condition evaluating the Start date. Instead you changed from looking at the parent issue of the trigger issue to looking at the issues linked to the trigger issues and trying to update the Start dates in the linked issues.

There are two ways to consider creating the rule. With your first re, each time the Start date is updated on a child issues it will check if the child issue Start date is earlier that the Start date currently in the parent and update the parent I'm that case. Though you do need to change the condition from "not equal to" to "is less than". You also need to add a  condition before the branch to make sure the trigger issue actually has a date (isn't blank), and within the branch to make sure the Start date of the Parent issue also is not blank. 

Another way to consider creating the rule is the path that you are sort of approaching in your second attempt. In that case when the Start date on a child changed you review all the children of the same parent to find the earliest Start date. You aren't going about it the correct way though.

Either method could work. The first it a bit simpler.

Let me know which you want to pursue and we'll dive deeper into that one.

Anita Pallas February 7, 2024

Let's go the first if that is simpler.

Trudy Claspill
Community Champion
February 8, 2024

This is the rule I would use. I'm going to show and explain it in sections.

Note this will work only when the issues are parent and child. This does not consider issues that are connected using the Issue Links functionality. If you truly need to consider linked issues, that is going to be a very different rule.

1. Trigger the rule on a change of the Start date field

2. Check the type of the issue that triggered the rule

3. This is a debugging step to print the Start date of the trigger issue into the rule execution audit log.

4. Confirm that there is a value in the Start date field. I assume you don't want to update the parent with a blank Start date.

Screenshot 2024-02-08 at 9.18.05 AM.png

 

5. Create a For Each Related Issue branch and select Parent. (If there is no parent issue the rule will not execute the branch.)

5.1. Another debugging step, this time to print the Start date of the parent issue into the log.

5.2. Check if the Start date of the parent issue is empty. If it is, then any date is "earlier" than empty and you'll want to update the parent issue.

5.3. Use an Edit Issue action to update the parent issue Start date field.

Screenshot 2024-02-08 at 9.23.49 AM.png

 

6. This is another branch, very similar to the first. The difference is that in this case the parent issue already has a value in its Start date field. So in 6.2 you check if the trigger issue Start date is earlier than the parent issue Start date.

Screenshot 2024-02-08 at 9.27.53 AM.png

 

 

The above rule only addresses the part of your task that concerns updating the parent issue start date to the earliest date of its child issues. This will run each time a child issue start date is updated.

You should be able to extrapolate from this a similar rule for updating the parent issue with the latest due date of the child issues.

This does not address the part of your task concerning creating new issue links.

This rule applies only to issues specifically related as parent and child, such as an Epic and its Child issues. This will not consider any issues that are listed only in the Issue Links section.

 

Why did I use two branches?

It would've been ideal to have just one branch, and under that an If-Else block that said:

If parent issue start date is blank, update it
Else-if parent issue start date is later than trigger issue start date, update it
Else do nothing (parent issue start date is earlier than child issue start date)

Unfortunately you can't have an If-Else block inside of a branch.

 

I also looked using a more complex comparison within a singe branch by using a JQL condition:
"Start date" is empty or "Start date" > {{triggerIssue.Start date}}

However the results of this were not consistent. In some cases where the JQL should've evaluated as true and the parent issue start date should've been updated, the JQL condition was evaluated as false instead.

 

I also tried using an If-Else block with the branches embedded in those blocks:

If parent exists and parent issue start date is empty
  For each Parent update start date
Else if parent exists and parent issue start date is later than trigger issue start date
  For each Parent update start date
Else do nothing

But that didn't work consistently either.

Anita Pallas February 8, 2024

Thank you @Trudy Claspill , this works perfectly. I have also managed to sort out copying the links from child issues (Core/Supporting/Story) to a parent (Epic) as well.

I am still stuck on adding dates from linked issues to a our Story issue (Core/Supporting), I have tried using what you provided to tweak it but nothing seems to work, I thought I would try before bothering you further.

Essentially, we need to do the same as above but where you have story it should be the linked issues and where parent is it would be the story. Are you able to assist with this one as well?Screenshot 2024-02-09 164332.pngScreenshot 2024-02-09 164347.png

Trudy Claspill
Community Champion
February 9, 2024

For simplicity I'm going to keep saying "Story" to refer to the type of issue where you want to update the dates.

You currently have a manual trigger on the rule. Is that what you expect to use going forward? Or do you expect the update to be triggered by some event?

The rule based on using a manual trigger from the Story you want to update would be significantly different from a rule that is triggered by the changing of a date in the linked issue, cause the update to the Story.

Also, do you want to evaluate the dates on all issues linked to the Story, or do you want to evaluate only the linked issues that use a specific link type, or the linked issues that are themselves of a specific issue type?

Could a linked issue be linked to more than one Story issue type?

 

Anita Pallas February 11, 2024

Hello @Trudy Claspill 

I did the manual trigger to see if I could get it working.

It would be better if the trigger is when an issue is linked.

We would be evaluating all linked issues.

A linked issue could be linked to more than one Story.

Linked issues will come from multiple projects across our jira but we would only want the rule to run on a specific project.

Anita Pallas February 14, 2024

Hello @Trudy Claspill any luck with this one?

Trudy Claspill
Community Champion
February 14, 2024

@Anita Pallas 

I am sorry but I am not currently able to spend time reviewing this. I will come back to it when I have time.

I can say that trying to manage this automation between a Story and its linked issues is going to be much more difficult.  

It would be better if the trigger is when an issue is linked.

So you don't care if the dates in the linked issues get updated?

Linked issues will come from multiple projects across our jira but we would only want the rule to run on a specific project.

Do you mean you want to update the Story issues in only one project, but consider dates from issue linked to it where the issues are from multiple projects?

Anita Pallas February 18, 2024

All good, I got this working in a roundabout way

Screenshot 2024-02-19 160249.pngScreenshot 2024-02-19 160239.png

Suggest an answer

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

Atlassian Community Events