Clone the month-end close template every month

Action: Clone work items (Clone)

The problem

Finance runs the same month-end close every month: one work item and 12 sub-tasks, each due a few working days after the start. Someone copies them by hand, fixes every due date, and re-attaches the checklist. Steps get missed, and dates land on holidays.

The native workaround

Automation's Clone work item action copies one work item, without its sub-tasks, attachments or links. A rule needs a branch per sub-task, and each one loses its order, its files and its links to the other steps. There's no way to move due dates by working days, and if the rule runs twice by mistake you get two sets.

With Kenshall Automation Actions

In a rule on a Scheduled trigger (the 1st of each month), add Clone work items:

  • Clone: The rule's work item. Run it against the template with a JQL search instead, e.g. labels = "month-end-template".
  • Children: All levels below (the default): every sub-task, in order, under its parent's clone.
  • Also copy: Attachments and Links (the default). Description images point at the clone's own copies.
  • Set fields: Summary = {summary} – {{now.format("MMMM yyyy")}}.
  • Move dates to: {{now}} on the Germany – Berlin calendar. The earliest due date lands on today's working day; every other date keeps its working-day gap, skipping holidays and closures.
  • Clone once per: Once a month. If the rule runs twice in a month, the second run reuses the first clones instead of making new ones.

Tick Preview only the first time: the run creates nothing, {{createdKenshallClone.created}} says how many clones it would make, and the Run log tab says about how many runs that takes. If a run was wrong, **Apps → Kenshall Automation Actions → Run log → Revert** deletes the clones nobody has changed since (deleting can't be undone; edited clones, and clones with new work items under them, are kept).

Allow the target project on the Safety tab first.

Smart values: {{createdKenshallClone.key}} (the top clone, e.g. to comment on it next), .created, .reused, .clonedItems, .attachments, .notCopied, .skipped, .failed and .preview.

What's copied: every field the target project lets an app set, description and rich text included; children; attachments; links (links between cloned work items point at the clones) and web links. Optional: comments (copied as internal unless they were public in a service project; restricted ones keep their restriction or aren't copied), watchers, status (when one transition gets there without a screen), and the latest open sprint.

What isn't: history, created date, votes and rank (clones are put in the template's order instead). Fields Jira refuses are named in notCopied. A work item with a security level or a role restriction its clone can't get isn't cloned at all.

Once per: a work item is cloned at most once per once key, even when the JQL also matches its parent: it's cloned inside the parent's tree. A tree with a work item Jira refused isn't finished, so running the rule again after fixing the cause clones what's missing.

Limits:

  • 40 clones per run and 150 work items per tree, both within the Safety tab's cap.
  • 5 levels, and files up to 15 MB.
  • A run answers Automation within about 20 seconds, and this recipe's template (12 sub-tasks, 2 files) clones in one run.
  • A bigger tree takes several runs. Until the last one, each run stops the rule with a message saying about how many runs are left. Running it again (by hand, or with a daily schedule and the same once key) carries on without duplicates.

Order: sub-tasks keep the template's order. Clone creates them side by side, then ranks them, which needs the rule's user to have the Schedule work items permission in the target project. Without it, Clone creates them one after another, which keeps the order but is slower (about 0.75 s each), so a template with many sub-tasks can take two runs.