The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Working with lookupIssues array.

Andrey Savelev
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Alex F
Contributor
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
Contributor
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. 

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events