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

Working with lookupIssues array.

Andrey Savelev January 3, 2023

Dear community,

Im trying to build an automation rule for the list of my leave requests built on Service Management portal request for HR repotring.

I have a "Lookup issue" component in my rule with the following parameters:

(project = hrsm and reporter = "XXX") and (("Start Date" > {{issue."Target start"}} and "Start Date" < {{issue."Target end"}}) or (duedate > {{issue."Target start"}} and duedate < {{issue."Target end"}}))

Then i check with advanced compare if {{lookupIssues.size|0}} is greater than 0.

And finally im adding the results to the issue commnet showing filtered issues start and end dates and calculating number of days used:

{{#lookupIssues}}
{{key}} From {{"Start Date"}} till {{duedate}} = {{"Start Date".diff(duedate)}}
\\ {{/}}

Below is an example of the output -

HRSM-81: Xmas and NY holidays APPROVED From 2022-12-19 till 2022-12-30 = 11 days

HRSM-43: Need a day off to attend my driving exam APPROVED From 2022-10-06 till 2022-10-06 = 85 days

HRSM-41: Trip abroad APPROVED From 2022-11-14 till 2022-11-18 = 46 days

HRSM-39: Personal reasons APPROVED From 2022-10-10 till 2022-10-10 = 81 days

And this is where i cant understand how to make it work the way i want.

{{key}} From {{"Start Date"}} till {{duedate}} part returns correct values, but {{"Start Date".diff(duedate)}} returns a difference between the last(first?) lookup issue "duedate" and every issue i have in my lookup array "Start Date"

As you can see for the topmost one calculation is correct 2022-12-19 till 2022-12-30 = 11 days, but for the second one it calculates 2022-10-06 till 2022-12-30(which is taken from the other issue).

Im totally out of ideas =(

The next step should be adding up all this resulting days and im asking for your help with that as well.

1 answer

0 votes
Alex F August 7, 2023

I ran into the same problem, looks like a bug. Since I'm not the first, I'll create a ticket.

Alex F August 8, 2023

Yes, this is a confirmed bug.

Like Deepak Rai likes this
Deepak Rai
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 18, 2024

Yes, it's a bug; I have also observed the same behavior with the minus function while subtracting two numbers. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events