The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Automate Weekly Recurring tasks to Last Business Day of Next Week

Jeremy Daugherty
Contributor
February 15, 2022

Certain administrative tasks must be done on a weekly basis. For these tasks I am trying to create a automation that creates a duplicate issue assigned to the same user for the next Friday. 

I am Cloning the issue based on the assigned component (Friday Recurring), but I am running into several issues.

  1. I can't determine how to set the Cloned issue due date to the next Friday. It needs to be the next Friday (or better, last business day of the next week) no matter what day of the current week it was completed.
  2. When this issue is Cloned it adds the word "CLONE" to the beginning of the summary field. Is there a way to eliminate this?
  3. Lastly, I can't get the component to clone to the new issue.

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

2 votes
Answer accepted
Mark Segall
Community Champion
February 15, 2022

Hi @Jeremy D 

Perhaps instead of cloning, you use an automation issue to create the cloned value.  Then copy pertinent information from the source to the new issue.  Here's how I would tackle your challenges:

  1. If I understand correctly, you don't want Friday of current week, but Friday of next week.  If so, here's how to get it
    1. {{now.withNextDayOfWeek("FRI").plusDays(7)}}
  2. Removing the CLONE to the beginning of Summary
    1. {{issue.summary.remove("CLONE")}}
  3. Should be able to copy from the source issue in your automation rule.
Mark Segall
Community Champion
February 15, 2022

I should add that #2 becomes irrelevant if you use automation to spawn the new issue instead of adjusting it after the fact.

Jeremy Daugherty
Contributor
February 18, 2022

This works except if I complete the task on Friday. Could I do the add days first (say 4 days) and then the Friday argument?

{{now.plusDays(4).withNextDayofWeek("FRI")}}

Mark Segall
Community Champion
February 18, 2022

Ahh - So if it occurs on Friday, you want it to be next Friday?  In that case you'll want something a little more complex.  The easiest way would be to add an IF condition to your flow.  Here's an example I threw together:

 

2022-02-18_10-54-27.png

For copy/paste purposes, here's what I used for the IF condition:

{{now.fullDate.left(3)}}
2 votes
Karyna Tyrnavska _SaaSJet
Atlassian Partner
May 20, 2022

Hi, @Jeremy D ! As an alternative, you can use the Business Process Manager add-on developed by my team. 

You can transform your tasks into Templates and set a schedule for each repetitive process. So, administrative tasks will be done on a weekly basis or as you wish.

99CD160E-AEC5-4AF5-8015-7CCCFA20BFAB.gif

TAGS
AUG Leaders

Atlassian Community Events