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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,112
Community Members
 
Community Events
184
Community Groups

Updating Dates via Smart Values and Automation

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

0 votes
Kris Dewachter
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.
May 07, 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

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
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.
May 09, 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

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