Automation | When an Epic contains multiple stories with different due dates, the most recent upcoming due date value should be copied to the Epic due date field

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

When an Epic contains multiple stories with different due dates, the most recent upcoming due date value should be copied to the pic due date field

Solution

Please find the rule details below:

  • Trigger: You can choose any trigger based on your requirement. For our example, we will chose the "Manual trigger"

  • Condition: Issue fields condition to check for Epic issue type only

"IF" Field Condition
  • Condition (Optional) - Related issue condition that checks for the due date field in all child issues of the trigger Epic. You can include this condition to ensure all subtasks with due dates populated are only considered when running the rule. If a child issue does not have a due date, the rule execution stops here

Related Issues Condition
  • Action: Lookup issues to run a JQL search of all child issues within the trigger Epic. Please ensure to order the JQL search results by due date so we can pick the most recent upcoming due date from the list:

LookupIssues Action
  • Action: Edit issue to populate the "Due Date" field of the trigger Epic with the due date field of the most recent upcoming child issue. The smart value used is:

{{lookupIssues.get(0).duedate}}

Edit Issue Component

Here is the JSON file if you would like to import this rule example for testing:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 { "cloud": true, "rules": [ { "id": 14624537, "clientKey": "fcb18f79-08d6-35bd-9c47-b1e204f45645", "name": "test due date", "state": "ENABLED", "description": "", "authorAccountId": "6362284b01c2ff842c19db70", "actor": { "type": "ACCOUNT_ID", "value": "557058:f58131cb-b67d-43c7-b30d-6b58d40bd077" }, "created": 1693820196863, "updated": 1693825300351, "trigger": { "id": "315828395", "component": "TRIGGER", "parentId": null, "conditionParentId": null, "schemaVersion": 1, "type": "jira.manual.trigger.issue", "value": { "inputFromUsers": false, "inputPrompts": [], "groups": [], "jQLFilter": null }, "children": [], "conditions": [], "connectionId": null }, "components": [ { "id": "315828396", "component": "CONDITION", "parentId": null, "conditionParentId": null, "schemaVersion": 3, "type": "jira.issue.condition", "value": { "selectedField": { "type": "ID", "value": "issuetype" }, "selectedFieldType": "issuetype", "comparison": "EQUALS", "compareValue": { "type": "ID", "modifier": null, "value": "10000", "multiValue": false, "source": null } }, "children": [], "conditions": [], "connectionId": null }, { "id": "315828397", "component": "CONDITION", "parentId": null, "conditionParentId": null, "schemaVersion": 1, "type": "jira.issues.related.condition", "value": { "relatedType": "stories", "linkTypes": [], "operator": "allmatch", "relatedJql": "", "compareJql": "duedate != EMPTY", "compareValue": 0, "similarityLimit": 40, "jql": "" }, "children": [], "conditions": [], "connectionId": null }, { "id": "315828398", "component": "ACTION", "parentId": null, "conditionParentId": null, "schemaVersion": 1, "type": "jira.lookup.issues", "value": { "id": "_customsmartvalue_id_1693816308347", "name": { "type": "FREE", "value": "lookupIssues" }, "type": "JQL", "query": { "type": "SMART", "value": "parent={{issue.key}} ORDER BY duedate DESC" }, "lazy": false }, "children": [], "conditions": [], "connectionId": null }, { "id": "315828399", "component": "ACTION", "parentId": null, "conditionParentId": null, "schemaVersion": 1, "type": "jira.create.variable", "value": { "id": "_customsmartvalue_id_1693816417617", "name": { "type": "FREE", "value": "test" }, "type": "SMART", "query": { "type": "SMART", "value": "{{lookupIssues.get(0).duedate}}" }, "lazy": false }, "children": [], "conditions": [], "connectionId": null }, { "id": "315828400", "component": "ACTION", "parentId": null, "conditionParentId": null, "schemaVersion": 1, "type": "codebarrel.action.log", "value": "{{lookupIssues.get(0).duedate}}", "children": [], "conditions": [], "connectionId": null }, { "id": "315828401", "component": "ACTION", "parentId": null, "conditionParentId": null, "schemaVersion": 1, "type": "codebarrel.action.log", "value": "{{lookupIssues.get(0).key}}", "children": [], "conditions": [], "connectionId": null }, { "id": "315828402", "component": "ACTION", "parentId": null, "conditionParentId": null, "schemaVersion": 1, "type": "jira.issue.refresh.issue", "value": { "delayMs": null }, "children": [], "conditions": [], "connectionId": null }, { "id": "315828403", "component": "ACTION", "parentId": null, "conditionParentId": null, "schemaVersion": 10, "type": "jira.issue.edit", "value": { "operations": [ { "field": { "type": "ID", "value": "duedate" }, "fieldType": "duedate", "type": "SET", "value": "{{test}}" } ], "advancedFields": null, "sendNotifications": true }, "children": [], "conditions": [], "connectionId": null } ], "canOtherRuleTrigger": false, "notifyOnError": "FIRSTERROR", "projects": [], "labels": [], "tags": [ { "id": 42220928, "tagType": "IS_RULE_UPDATED", "tagValue": "true" } ], "ruleScope": { "resources": [ "ari:cloud:jira::site/7bbd0f61-9cf7-46a8-a02c-5d635b174db8" ] }, "ruleHome": { "ruleLifeCycleHome": { "locationARI": "ari:cloud:jira-servicedesk::site/7bbd0f61-9cf7-46a8-a02c-5d635b174db8" }, "ruleBillingHome": { "locationARI": "ari:cloud:jira-servicedesk::site/7bbd0f61-9cf7-46a8-a02c-5d635b174db8" } }, "writeAccessType": "UNRESTRICTED", "collaborators": [], "billingType": "NORMAL" } ] }

Updated on May 31, 2024

Still need help?

The Atlassian Community is here for you.