Uploaded image for project: 'Automation for Cloud'
  1. Automation for Cloud
  2. AUTO-334

Using `.diff` function for dates inside multiple lookupIssues block uses wrong arguments

    XMLWordPrintable

Details

    • Minor

    Description

      Issue Summary

      When you combine the use of a lookupIssues block and the diff function, when there are multiple issues, the diff function remembers the argument for the first issue, and uses it for all subsequent issues (rather their using the argument for each respective issue).

      Steps to Reproduce

      Create an automation rule with the following specs:

      1. Trigger: Scheduled
      2. Action1: Lookup Issues
        1. Lookup 2+ resolved issues (with different resolved times)
      3. Action2: Add "Log Action" action with this smart value:
        1. {{#lookupIssues}} {{key}} From {{created}} till {{resolved}} --- {{created.diff(resolved)}}  \\ {{/}} 

      Expected Results

      SP-6 From 2023-02-07T06:53:00.0+0000 till 2023-02-07T07:31:12.6+0000 --- 38 minutes 12 seconds \\
      SP-5 From 2023-02-07T06:52:44.9+0000 till 2023-02-07T06:53:04.1+0000 ---  0 minutes 20 seconds \\ 

      Both diffs should be correct: 38m 12s, then 0m 20s.
      h3. Actual Results

      SP-6 From 2023-02-07T06:53:00.0+0000 till 2023-02-07T07:31:12.6+0000 --- 38 minutes 12 seconds \\
      SP-5 From 2023-02-07T06:52:44.9+0000 till 2023-02-07T06:53:04.1+0000 --- 38 minutes 27 seconds \\ 

      The 2nd (and subsequent diffs) are wrong. It shows 38m 12s
      , then 38m 27s.

      The reason is that the diff function is using the resolvedDate from the first Issue (SP-6) instead of the resolvedDate from the current issue (SP-5).

       

      Workaround

      Currently there is no known workaround for this bug.

      Attachments

        Activity

          People

            Unassigned Unassigned
            42f170a9d44d Stephen Wrathall
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: