Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation: How to automatically create a Story every month with being linked to different Epic

Caleb Park August 21, 2023

Hi guys,

 

Is there a way to build an automation that automatically creates a Story that should be linked to a certain Epic every month?

 

For example, I already have monthly Epics with names like Jan 2023, Feb 2023, Mar 2023, Apr 2023, etc.

And I want to create a Story on every 25th of the month and it should be linked to applicable Epic.

On August 25th, a Story gets created under "Aug 2023" Epic.

On September 25th, a Story gets created under "Sep 2023" Epic.

On October 25th, a Story gets created under "Oct 2023" Epic.

 

I know how to do this by creating every different automation for every single Story, but I am wondering if there is any way to make it work in ONE automation.

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 22, 2023

Hello @Caleb Park 

Yes, this is possible.

You can set up a rule that uses a Schedule trigger to run on the 25th of each month.

In that rule you can create the Story issue.

You can use this smart value to get the Month portion of the current date.

{{now.format("MMM")}}

With that you can execute a Lookup Issues action to find the Epic that has that month in its summary, using JQL:

summary ~ "\"{{now.format("MMM")}} 2023 \"" and issuetype=Epic

You can confirm that you got exactly one matching epic by using a Condition to check the size of the results set from the Lookup Issue action is 1.

{{lookupIssues.size}} equals 1

If that passes, you can get the key for the Epic in the results set using

{{lookupIssues.first.key}}

You can use that to set the "Epic Link" field for the new issue you create.

Caleb Park August 22, 2023

@Trudy Claspill 

Hi Trudy,

Where can I find "Lookup Issues action" from automation"?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 22, 2023

You can find that action described on the documentation page that describes all the available actions:

https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues

From within the Automation Rule UI you can find it under the Add An Action option.

Screen Shot 2023-08-22 at 11.53.26 AM.png

Caleb Park August 22, 2023

10.PNG

 

Our current JIRA system does not have it.

 

Also, one more question.

You've mentioned that i can use this one in JQL:

summary ~ "\"{{now.format("MMM")}} 2023 \"" and issuetype=Epic

But when I try to use this in JQL, it does not work. It gives this error.

11.PNG

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 22, 2023

Adding tags to your posts in the community to identify your hosting type is very helpful to us to ensure we provide responses relevant to your environment. It sounds like you are working with Jira Server or Jira Data Center. Is that correct? Automation for Jira for those hosting types does not include the Lookup Issues action.

 

You've mentioned that i can use this one in JQL:

summary ~ "\"{{now.format("MMM")}} 2023 \"" and issuetype=Epic

That only works in JQL statements within the Automation Rules. {{now.format("MMM"}} is a smart value. It can only be understood within Automation Rules, not within the normal Issue Search screens.

 

Since you don't have access to the Lookup Issues action an alternative would be to put the JQL into your Schedule trigger to first find the current month's Epic. Then you can add the steps to create the new Story and use {{issue.key}} to set the value of the "Epic Link" in the created issue.

Caleb Park August 22, 2023

@Trudy Claspill 

Yes, I am working with JIRA Server or JIRA Data Center.

 

So, using your alternative way, when I put the JQL into my Schedule trigger, "Validate Query" does not provide anything.

15.PNG

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 22, 2023

Within Automation Rules the JQL fields cannot run Validate query when the JQL includes smart values.

Screen Shot 2023-08-22 at 1.32.29 PM.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events