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.
I ran into the same problem, looks like a bug. Since I'm not the first, I'll create a ticket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, it's a bug; I have also observed the same behavior with the minus function while subtracting two numbers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.