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

Automation to send an email when the renewal date is approaching

Tim Larkman September 11, 2024

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? 

3 answers

1 accepted

2 votes
Answer accepted
Manon Soubies-Camy
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2024

Hi @Tim Larkman,

I agree with @Trudy Claspill, 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). 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

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

 

Tim Larkman September 17, 2024

Hi @Manon Soubies-Camy 
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

Manon Soubies-Camy
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 17, 2024

Hi @Tim Larkman, 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

Like Tim Larkman likes this
Tim Larkman September 19, 2024

Hi @Manon Soubies-Camy 

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

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. 


This is the comment i would expect not to receive. 
Ven-6.png

This is the rule details.

rule.png

 

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

Manon Soubies-Camy
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 19, 2024

Hi @Tim Larkman,

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

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

Like Tim Larkman likes this
Tim Larkman September 19, 2024

Hi @Manon Soubies-Camy 

Sure thing, Please see below screen shots

notice period.png

 

reminder date.png

Manon Soubies-Camy
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 19, 2024

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

Like Steffen Opel _Utoolity_ likes this
Tim Larkman September 20, 2024

Thanks @Manon Soubies-Camy 

You're a legend! it works perfectly now. 

Like Manon Soubies-Camy likes this
Manon Soubies-Camy
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 20, 2024

Very happy to hear it's now working! :)

0 votes
Bill Sheboy
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.
September 12, 2024

Hi @Tim Larkman -- 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

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.
September 11, 2024

Hello @Tim Larkman 

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?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events