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

Need help on automation with dates

Rosana Casilli
Contributor
May 8, 2024

Hi all!

 

One of the project lead wants to classify some issue taking into account the hour and minute of the date created.

 

IF the issue was created after 19hs 00 min

 then 

     update  customefieldx= Yes

else

    update  customefieldx= No

 

How can I do that comparission?

Thanks in advance

 

Ro

1 answer

1 vote
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 8, 2024

Hi @Rosana Casilli 

The rule could use the date / time function format() to get the hour from the created date / time, and then use rule conditions on the result.  Please look here to find additional options for that function: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-format---

Kind regards,
Bill

Dave Rosenlund _Trundl_
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 8, 2024

Also, check out this previous post and the answer provided by Mark Segall in the thread below.

I just threw away a suggested solution I was working on because I remembered to search the community first, and I see now that Mark is much smarter than I am. And so is Bill byh the way. 😉

Solved: Check is time is between range of time - Jira autoamtion

Best,

-dave

 

Rosana Casilli
Contributor
May 9, 2024

Hi @Dave Rosenlund _Trundl_ !! thank you for your response... 

 

I have tried to use what it is mentioned in that post.. but... I do not know why, the Hour and minute it is always showing the same value

 

I create a rule (on create issue)  where I compare this two values:

if {{issue.created.convertToTimeZone("America/Argentina/Buenos_Aires").format("H")}} equals 13

and

{{issue.created.convertToTimeZone("America/Argentina/Buenos_Aires").format("M")}} greater than 7

then 

Edit issue, and here I update a field.

 

Since I tested and didn´t change the value when "I supposed" the condition was true, then before the condition I put a send mail with the values in the condition. What i see is at the time the issue is created, that the values for {{issue.created.convertToTimeZone("America/Argentina/Buenos_Aires").format("H")}} is 13 (that is correct), and the value for {{issue.created.convertToTimeZone("America/Argentina/Buenos_Aires").format("M")}} is 5

but the created date has 13:07

 

It doesn't matter how many times I create an issue ( in different minutes difference) the values that returns those smart values are always the same, it is always showing 13 and 5 

 

Can you help me with this?

 

Thanks in advance,

Ro

 

 

 

Like Dave Rosenlund _Trundl_ likes this
Dave Rosenlund _Trundl_
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, 2024

I'm sorry to say that we've exceeded my Automation expertise, @Rosana Casilli . Maybe @Bill Sheboy will know.

He's a wizard, whereas I'm just a novice.

Like Rosana Casilli likes this
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 9, 2024

For the format() function, "H" is the hour-of-the-day and "M" is the month-of-the-year.

Did you want to use "m" for minute-of-the-hour instead?

Like # people like this
Rosana Casilli
Contributor
May 9, 2024

Thank you both @Bill Sheboy  and @Dave Rosenlund _Trundl_ 

a big mistake from my side!! it works!

Like # people like this

Suggest an answer

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

Atlassian Community Events