Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

Using variable in the endOfWeek() function

Tom Scoggin
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.
January 12, 2024

I created two Variables and was trying to pass them to the endOfWeek() function like this. 

{{#issues}}
{{#if (and(created.isAfter(endOfWeek(WeekVarOne)), created.isBefore(endOfWeek(WeekVarTwo))))}}

If I replace the variable with a number like -1 or -8 the statement works just fine. I can also print the variables to my email. I just can't get them to work in this situation. I also tried to use WeekVarOne.asNumber and that didn't work.

Any thoughts? Also, can you iterate the variable inside of a While loop?

Thanks in advance.

2 answers

0 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2024

I don't believe using an automation variable inside JQL parameters is supported. Have you seen info supporting this?.

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

Hi @Tom Scoggin 

Short answer: no, that is not possible.

Once inside of an iterator, an automation rule cannot "see" anything except at that scope, and lower.  It cannot see other issues, variables, or even data at a higher scope within the same issue which is the source of the iterator.

My understanding from other posts is the Atlassian team has tried to address this a few times, without success.

The only work-around I know is to use the match() function with a regular expression when using the inline version of iteration.  However that would not work for your scenario as you want to filter on one thing (i.e., created) and then access other fields.

Based upon your other question (for table data), you could also use multiple calls to Lookup Issues, with different JQL for each, and save the pre-formatted table data in created variables.  Then use those variables in an email, message, etc.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer