Automation: Create issue on due date
Asked by Yasmine:

Hi everyone,

I'm trying to create an automation to do the following:

If issue type = X and due date is today then create issue

Note: We are using epics but the trigger issue would not be the epic itself, however, the trigger issue would be under the epic. Not sure if that changes anything but thought it was important to note.

Thanks in advance!


Answers:
author: Fernando Eug?nio da Silva
body: [@Yasmine](/t5/user/viewprofilepage/user-id/4995589)

You can create a rule like this:

Trigger: Scheduled \> Set to one time everyday

* Check the JQL Box and select your query, similar to this: **issuetype = "Task" AND duedate = now()**
* Uncheck the box "***Only include issues that have changed since the last time this rule executed***"

![Screenshot_121.png](https://community.atlassian.com/t5/image/serverpage/image-id/265641i7FE93888B24E5787/image-size/large?v=v2&px=999 "Screenshot_121.png")

After this, just configure an Action event to create a new issue in Jira. Select the fields you want to set, including Epic Link if you want it. Save your rule and publish.

Everyday in the time specified Jira will run the rule and for issues that 'duedate' is today a new issue will be created.

Regards,

Fernando

comments: author: Yasmine
body: [@Fernando Eug?nio da Silva](/t5/user/viewprofilepage/user-id/4606715) Here is the automation i have set up.  
All the fields copy over except the epic, it adds it as a linked issue but not as the epic to the issue![automation-epic.png](https://community.atlassian.com/t5/image/serverpage/image-id/266101i4ABB624BC7D8A6C2/image-size/large?v=v2&px=999 "automation-epic.png")![Screenshot 2023-06-30 140535.png](https://community.atlassian.com/t5/image/serverpage/image-id/266102iEC7587DB1D881C4B/image-size/large?v=v2&px=999 "Screenshot 2023-06-30 140535.png") (highlighted in 2nd screenshot).


author: Fernando Eug?nio da Silva
body: [@Yasmine](/t5/user/viewprofilepage/user-id/4995589)

Is this your rule at all?

It doesn't make much sense for you to put the condition:

Epic Exists

Unless you're creating an issue within an Epico of course.

Also, is this linked issuetype an actual Epic or is it an issuetype that is added to the same level as Epic in the Jira Hierarchy?

If is an Epic you should just fill the field Epic Link with the Epic key and select the Epic displayed.

If it's the second option, you need to pass the smart value in the additional fields option:

```
{
"fields": {
"Parent Link": "PARENT_KEY"
}
}
```

If you have problem still. Please, share your full rule sending screenshot and i will try to replicate the same rule on my environment


author: Yasmine
body: This rule is the first rule in the workflow. The issue is being created as a linked issue under the epic.

I tried passing the smart value through additional fields and it didn't work. Here is a screenshot of the entire automation.

Thanks for your help :) ![Screenshot 2023-06-30 150444.png](https://community.atlassian.com/t5/image/serverpage/image-id/266109i40C66922262D7758/image-size/large?v=v2&px=999 "Screenshot 2023-06-30 150444.png")


author: Fernando Eug?nio da Silva
body: [@Yasmine](/t5/user/viewprofilepage/user-id/4995589)

I'm a litle confused. lol

Your automation wants to add an Epic into a Issue but you added a condition '**IF Epic Exists**' so doesn't makes much sense.

Could you describe exactly what it is your main idea with this rule? At the first contact you was talking about ***create a task everytime duedate is equals the current day***. But your current automation rule doesn't mean this.

If you prefer talk about this more directly, feel free to scheduled a meeting by [here](https://calendly.com/fernando-eugenius/30min).

Hope hear you :)


author: Yasmine
body: [@Fernando Eug?nio da Silva](/t5/user/viewprofilepage/user-id/4606715)

Thanks for your help. The automation worked however, it's not linking the trigger issue or the epic. ![Screenshot 2023-06-28 161309.png](https://community.atlassian.com/t5/image/serverpage/image-id/265644i1F04C42F4D012133/image-size/large?v=v2&px=999 "Screenshot 2023-06-28 161309.png")

comments: author: Fernando Eug?nio da Silva
body: [@Yasmine](/t5/user/viewprofilepage/user-id/4995589) , you need to adjust your fields on your automation rule

To link the trigger issue you need to select the field 'Linked Issues' and choice the link type to link the both issues.

To link the Epic you need to select the field 'Epic Link' and you can add the Epic manually or can copy the same Epic of the trigger issue.


Tags: cloud