now function in jira automation does not return correct values

Nilesh G May 12, 2024

Here're the values returned by now function at different times.

May 12 @ 09:18pm IST - 2024-05-12T15:48:54.3+0000

May 12 @ 09:19pm IST - 2024-05-12T15:30:38.3+0000

1 answer

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.
May 12, 2024

Hi @Nilesh G -- Welcome to the Atlassian Community!

Context is important for automation rule questions.

Please post an image of your complete automation rule, an image of each action where you are using {{now}} as you describe, an image of the rule details (at the top) to show the rule configuration settings, and an image of the audit log details showing the rule execution.  That information may help the community to offer better suggestions.

Kind regards,
Bill

Nilesh G May 12, 2024

Hi @Bill Sheboy  ! Thanks for prompt response. Here's the context.

We've an automation rule for setting the value of a date and time picker custom field based the minute of the hour.

1. For the first 15 mins, value is set to beginning of the current hour

2. From 15 to 45 mins, value is set to 30th minute and

3. For the last 15 mins of the hour, value is set to start of next hour {{now.plusHours(1).minusMinutes(now.minute)}}

First two rules work as expected, however, the last one returns inconsistent results. In order to investigate further, an action is included to capture value of now to audit log. That's when following is observed.

Value returned by now at 9:18pm IST2024-05-12T15:48:54.3+0000

Value returned by now at 9:19pm IST2024-05-12T15:30:38.3+0000

Here're the snapshot of automation rules.

Screenshot 2024-05-13 at 9.50.24 AM.png

Screenshot 2024-05-13 at 9.54.08 AM.png

Screenshot 2024-05-13 at 9.55.32 AM.png

Screenshot 2024-05-13 at 9.57.14 AM.png

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.
May 13, 2024

Thanks for that information. 

As a tip for community questions about automation rules, try using a scrolling browser addon or screen capture app to contain the entire rule in one image.  That will ensure it shows with the full context / alignment.

Back to your question...I wonder if this is related to the half-hour part of the IST time zone, relative to {{now}} being returned in UTC.  Perhaps try converting to the IST time zone first before capturing the minute value:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Convert-timezone-date---

Nilesh G May 13, 2024

Hi @Bill Sheboy  ! Problem lies with one of the else/if conditions in my rule which is set wrongly. Anyways, thanks for your inputs.

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.
May 13, 2024

To confirm, have you solved your question by fixing one of the conditions?  Thanks!

Nilesh G May 13, 2024

Yes. That's true.

Suggest an answer

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

Atlassian Community Events