Automation to send an email when the renewal date is approaching
Asked by Tim Larkman:

We have a Team Managed project in Jira that tracks the status of all our vendors.

Some of the notable fields we have include the following:

Business Owner (people field) - The person who has the relationship with the vendor

Renewal date (date field) - This is the date that the contract with the vendor is set to renew

Notice period (dropdown list) - The is the number of days required to give notice for the cancelation of the contract. Available options include, 30 days, 60 days, 90 days

I would like to create an automation rule which will send an email reminder to the business owner stating that the contract is due for renewal soon. The notification should go based on the notice period.

As an example. If the renewal date is 30 Nov and the notice period is 30 days, Then i should be able to send an email reminder to the business owner say 45 days prior to the renewal date.   

is this possible using Automation and if so how would i do that?


Answers:
author: Manon Soubies-Camy
body: Hi [@Tim Larkman](/t5/user/viewprofilepage/user-id/5589667),

I agree with [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011), you need a Scheduled trigger and conditions to compare dates. I would also add that:

* Team-managed projects have a limitation where People custom fields, such as your Business Owner one, aren't supported by Jira Cloud automations at the moment ([see more info here](https://support.atlassian.com/cloud-automation/docs/limitations-in-team-managed-projects-for-automation-rules/)). You could use the Assignee field instead of the Business Owner one.
* I would recommend adding a comment to the Jira issue rather than sending an email. This will help tracking renewal history and decisions.
* I would also recommend having a dedicated workflow status, for example "Renewal evaluation".

This is what your automation rule would look like:

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

Below are the smart values I'm using:

* noticePeriod variable: {{Notice period.value.split(" ").first}}
* reminderDate variable: {{Renewal date.minusDays(noticePeriod.asNumber)}}
* Condition: {{now.diff(reminderDate.toDate).days}}
* Assignee mention: \[\~accountid:{{assignee.accountId}}\]

Hope this helps!

- Manon

comments: author: Tim Larkman
body: Hi [@Manon Soubies-Camy](/t5/user/viewprofilepage/user-id/1215212)   
thanks for your very detailed response.   
I have created a new "Service management" project to handle my vendors. I found it gave me more flexibility.  
In your automation field for "if Compare two values" is it taking the reminder date and subtracting 15 days to it? So for example.   
Renewal date = 30 November  
Notice Period = 30 days  
Reminder date is thus 31 Oct. It then subtracts 15 days which takes us to 16 Oct.   
The comment will then get sent on 16 Oct to the business owner? Is my understanding correct?   

Also, Not sure why the rule doesn't like my "Status is not one of" Policy? Any Ideas? ![2024-09-17 11_37_56-Rule builder - Automation - Vendors_System - Jira.png](https://community.atlassian.com/t5/image/serverpage/image-id/347709iD2CE5EEF41C55225/image-size/large?v=v2&px=999 "2024-09-17 11_37_56-Rule builder - Automation - Vendors_System - Jira.png")


author: Manon Soubies-Camy
body: Hi [@Tim Larkman](/t5/user/viewprofilepage/user-id/5589667), yes, you're correct! Notice period = 30/60/90 days, and 15 is the number of days you want add on top of that to get your reminder on time.

For the "Incompatible component" error, it might be due to your Scheduled trigger, did you filter with a JQL query?

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


author: Tim Larkman
body: Hi [@Manon Soubies-Camy](/t5/user/viewprofilepage/user-id/1215212)

With your help i have managed to get this mostly working with only one hiccup remaining.

The "if: Compare two values" doesn't seem to want to work.   

The audit log shows the following.

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

The issue condition part works perfectly.

The problem is in the Smart Values condition.

I would expect a comment to get generated for VEN-5 and VEN-1 but VEN-6 has a renewal date of 28 Aug 2025 so i would expect not to get a comment generated for this Vendor but regretfully i do. Not sure what im doing wrong here.

<br />

This is the comment i would expect not to receive.   
![Ven-6.png](https://community.atlassian.com/t5/image/serverpage/image-id/348135i653FBBE071BDFA87/image-size/large?v=v2&px=999 "Ven-6.png")

This is the rule details.

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

As always, many thanks for your help on this issue.


author: Manon Soubies-Camy
body: Hi [@Tim Larkman](/t5/user/viewprofilepage/user-id/5589667),

Thanks for the detailed screenshots! That's very weird because I tried using your values (renewal in August 2025 with a 60 days notice period), and it works as expected on my end: no comment is triggered for that issue.

![smart-condition-audit-log.png](https://community.atlassian.com/t5/image/serverpage/image-id/348174i26C64715BA409777/image-size/large?v=v2&px=999 "smart-condition-audit-log.png")

Can you share a screenshot of your reminderDate and noticePeriod variables' configuration?


author: Tim Larkman
body: Hi [@Manon Soubies-Camy](/t5/user/viewprofilepage/user-id/1215212)

Sure thing, Please see below screen shots

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

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


author: Manon Soubies-Camy
body: Ah, I found a typo in your noticePeriod variable: can you try and add a space in the smart value? You should type in the name of your custom field (which has a space), instead of the variable (which doesn't have a space):

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


author: Tim Larkman
body: Thanks [@Manon Soubies-Camy](/t5/user/viewprofilepage/user-id/1215212)

You're a legend! it works perfectly now.


author: Manon Soubies-Camy
body: Very happy to hear it's now working! :)


author: Bill Sheboy
body: Hi [@Tim Larkman](/t5/user/viewprofilepage/user-id/5589667) -- Welcome to the Atlassian Community!

Adding to the other suggestions provided:

People-type fields (e.g., your Business Owner field) do not provide the email address to automation rules at this time: <https://jira.atlassian.com/browse/AUTO-519>

The two possible workarounds are:

1. Using the accountId from the user field, call the REST API endpoint with the Send Web Request action to get the user's data, including the email address: <https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828>
2. Replace your team-managed project's People-type field with a global / company-managed user-picker field. Team-managed projects now allow using those shared fields to help ensure consistency across team-managed projects (and to solve limitations like with the People fields).

Kind regards,  
Bill


author: Trudy Claspill
body: Hello [@Tim Larkman](/t5/user/viewprofilepage/user-id/5589667)

Welcome to the Atlassian community.

Yes, it is possible. You could use an Automation Rule with a Scheduled trigger. The trigger could include a JQL to select the issues that match criteria. Perhaps you want to select all the issues for which the renewal date is in the future, or where the renewal date in sometime in the next 365 days.

You would schedule the rule to run daily.

You would then use conditions to determine if an email should be sent. The specifics of the conditions require clarification:

How do you determine that when the notice period is X days then you want to send the email at X+n days before the renewal date? How do you determine what "n" should be?