Forums

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

How can I run a scheduled rule every month that creates different issues based on current month?

Walter Lamm
Contributor
October 11, 2023

Hi community.

I wanted to create a rule that triggers on the first day every month but creates different issued based on the current month of execution.

Example:

  • January: Issue A, Issue B, Issue C
  • February: Issue C
  • March: Issue A, Issue C
  • April: Issue B, Issue C

I don't want to create a scheduled rule for every month to have it consider which specific issues should be created right now.

I wanted to build a rule, that triggers every month but checks which month is right now and based on that creates these different issues in my list.


The way I wanted to implement it more specificly was:

  • Scheduled trigger
  • Create lookup table (table name: irregularIssues):
    • Key: Month | Value: Issue A§Issue B§Issue C
  • Advanced Branching for each:
    • Smart value: {{irregularIssues.get(insert_current_month_here).split("§")}}
    • Variable name: irregularIssuesName

    • Then: Create issue
      • Summary: {{irregularIssuesName}}

 So how can I implement a check for the current month that isn't included in any custom fields?

Or is there an easier way I'm just missing?

Thanks a lot!

4 answers

3 accepted

3 votes
Answer accepted
Seifallah Bellassoued
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 11, 2023

Hi @Walter Lamm

 

To do that I suggest the following steps:

  1. Add a scheduled automation rule with the follwowing cron parameter:
    2023-10-11 12 17 56.png
  2. Then add 12 if/else condition block with the following advanced condition:
    • First value: {{#math}} {{now.format("MM")}} {{/}}
    • Second Value: Month number
      2023-10-11 12 15 34.png

  3. Under each condition, you should add an action to created the corresponding tasks.

Hope this could help.

Best Regards,

Seif,

Walter Lamm
Contributor
October 11, 2023

@Seifallah Bellassoued @Tom Lister @Marc - Devoteam @Vishal 

Thank you for your answers! Seifallahs answer was all I needed.

Here's how I did it with new parts in bold:

 

  • Scheduled trigger
  • Create variable {{currentMonth}} with value:
    • {{#math}} {{now.format("MM")}} {{/}} (though I don't think the #math part is necessary)
  • Create lookup table with only the months with issues that need to be created
    • table name: irregularIssues
    • Key: Month in format MM | Value: Issue A§Issue B§Issue ClookupTableMonth.jpg
  • Advanced Branching for each:
    • Smart value: {{irregularIssues.get(currentMonth).split("§")}}
      • split is for creating a list to iterate through from only one lookup table value
    • Variable name: irregularIssuesName

    • Then: Create issue
      • Summary: {{irregularIssuesName}}
Like # people like this
2 votes
Answer accepted
Tom Lister
Community Champion
October 11, 2023

Hi @Walter Lamm 

I agree with the comments above but would add:

Schedule trigger monthly as suggested.

You can create a variable for the current month and use that for further logic.

Variable smart value such as {{now.format("MMM")}} to return Jan,Feb etc.

Screenshot 2023-10-11 at 10.26.44.png

When I have had to create issues with specific values on a regular basis I have created template issues. These were a specific issues with predefined values. I located these via JQL (e.g. Labels = "Oct" ). You can do this using a Branch based on JQL.

And created new issues based on their values.

Screenshot 2023-10-11 at 10.57.36.png

This has an additional benefit of allowing the predefined values to be adjusted outside of automation

1 vote
Answer accepted
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 11, 2023

Hi @Walter Lamm 

You could look into automation date/time smart values.

example: {{now.startOfMonth.withMonth(5)}} will return the 1st of May this year. and base you actions on the value from the smart values

0 votes
Vishal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 11, 2023

Hi @Walter Lamm 

What you are looking for is 2 levels of time checker, I dont think this is currently possible with the automation, I fear you'll have to do what you dont want to do, which is creating scheduled rule for each month.

Happy to be proven wrong though.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events