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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

date smart value function ofTheMonth not working inside function

Variables

newDate is set to "2021-04-01"

myNumber is set to "4"

myN is set to "1"

myDay is set to "1"

 

Here is what is working "plusDays":

{{#newDate.toDate}}func=plusDays({{myNumber}}){{/}}

returns: "2021-04-05T00:00:00.0+0000"

 

Why can I not do the same with the "ofTheMonth":

{{#newDate.toDate}}func=ofTheMonth({{myN.asNumber}},{{myDay.asNumber}}){{/}}

returns: "2021-04-01T00:00:00.0+0000"

If I log just the inside portion (func=ofTheMonth({{myN.asNumber}},{{myDay.asNumber}})) I get:

func=ofTheMonth(1,1)

 

1 answer

Hi @Garrett McCreery 

My understanding is that created variables do not work as parameters to functions yet: 

https://codebarrel.atlassian.net/browse/AUT-2022

What problem are you trying to solve?  Knowing that may help the community suggest other ways of getting the result with automation.

Best regards,

Bill

created variables has nothing to do with my issue. What I am asking is why some functions like "plusDays" works, but "ofTheMonth" does not in my examples above.

Garrett, would you please post an image of your complete automation rule?  That may provide context as you note you are not using created variables and yet you seem to be using variables in the function calls.

If posting the image is not possible, I suggest working with your site admin to submit a defect to customer support for their assistance: https://support.atlassian.com/contact/#/

I'm not saying that I am not using created variables, I'm saying that they have nothing to do with my issue... 

1. Here is the function "plusDays" being used in a "func" statement and it works fine:

 

Untitled.png

 

 

Here is the function "ofTheMonth" where I am trying to use it in a "func" statement and it is not working. You will see that the function does work, it's just not working with a "func" statement. 

 

 

Untitled 2.png

 

So back to my original question, why do some functions work with the "func" statement, while others do not?

Maybe it's only ".OfTheMonth" that is not working with a "func" statement, most of the other date functions work fine.

https://support.atlassian.com/jira-software-cloud/docs/smart-values-date-and-time-functions/

Honestly, I have no idea why that function is different.  And I am still surprised you are getting results with created variables as function parameters.

The only open defect I saw for func() and date functions is a problem interpreting string fields as numeric values: https://codebarrel.atlassian.net/browse/AUT-1791

If you have a specific need for a day of week, you might try working around with withNextDayOfWeek() and plus/minus the date.  I have done that to build calendar tables with automation in the Description.

I have already created a work around using 5 separate variables. thanks for looking!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

638 views 16 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you