Missed Team ’24? Catch up on announcements here.

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

Updating Dates via Smart Values and Automation

Haig Aboyan May 4, 2023

I am trying to update the "Due date" field within a created issue. The created issues are for the review of our Vendors. We have an object type called "Vendors" where all Vendors are stored. The created issue's "Due date" should be based off of the "Next Performance Review Date" attribute stored within each Vendor object. Screenshot 2023-05-04 at 11.10.58 AM.png

 

You can see below, the automation checks our defined criticality of the vendor and depending on the criticality and the next performance review date, the due date is determined. To me the smart value makes sense, but every-time I run the automation it completes successfully but the due date is not updated within the issue.Screenshot 2023-05-04 at 11.12.18 AM.png

1 answer

1 vote
Kris Dewachter
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 7, 2023

Hi @Haig Aboyan ,

can you share the details of the audit log of the automation rule execution ?

Also, to help debugging, you can add a "Log Action" action component to your automation rule. If you add the smart value there, the result of your date calculation will be added to the audit log. Like this, you can check what date is calculated.

Best regards,

Kris

Haig Aboyan May 8, 2023

Hi Kris,

 

When I "Log Action" and use the following smart value {{lookupObjects.Next Performance Review Date}}, the correct value is populated. However, if I try to change the smart value to {{lookupObjects.Next Performance Review Date.plusDays(274)}}, the value is blank. The same result is reflected in the automation log:

Screenshot 2023-05-08 at 4.48.15 PM.png

Kris Dewachter
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 9, 2023

Hi @Haig Aboyan ,

The problem is caused by the different date formats used by your asset object and Jira.

When you retrieve your "Next Performance Review Date" from your vendor object, the date format is 22/Feb/23. Unfortunately, this date format does not allow you to perform date calculations on it. That is why your automation rule fails.

I found a solution in this community article: https://community.atlassian.com/t5/Jira-articles/Jira-automation-and-Insight-Acquiring-an-insight-date-attribute/ba-p/2111333. This article explains how you can convert the asset date format to a Jira date format using a regex.

 

In your automation rule you need to:

 

1. Put the object date into a Variable 

Snip20230509_93.png

2. Next, you can use the regex mentioned in the article to convert the variable date to a "2023-02-22" Jira date format. In the same step, you can add a number of days to this date and set this value as the due date. To do this, you add a 'Edit Issue' component to your workflow, and set 'Due Date' to this smart value

{{NextDate.match("((\d{2})\/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\/(\d{2}))$").toDate.plusDays(274)}}

 

Hope this works,

Best regards,

Kris

Kris Dewachter
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 6, 2023

Hi @Haig Aboyan ,

I hope my answer helped you fix the issue. If so, can you please accept the answer so it can help others in the future ?

Thanks,

Kris

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events