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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Within Automation Rules the JQL fields cannot run Validate query when the JQL includes smart values.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.