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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,507
Community Members
 
Community Events
176
Community Groups

Working with lookupIssues array.

Edited

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.

0 answers

Suggest an answer

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

Atlassian Community Events