Uploaded image for project: 'Xporter for Jira'
  1. Xporter for Jira
  2. XPORTER-702

Set function doesn't correctly update mappings

    XporterXMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Release 3.4.8, Release 4.1.0
    • 5.0.0
    • Document Engine
    • None
    • UNCOVERED

    Description

      Xporter for JIRA is resolving mappings on document before all processment is done.
      Updating a variable value with set function will not update the pre-resolved mapping of that variable with the new value.
      This can be bypassed and resolved surrounding the line with the variable on the document with a "if-true" conditional block.

      Example:

      ${set(Found,1)}
      Initial Found: ${Found}
      #{if (%{${Found} > 0})}
      It's working!!!
      ${set(Found,2)}
      #{end}
      
      
      Unwanted Found Value: ${Found}
      #{if (%{true})}
      Updated Found Value: ${Found}
      #{end}
      
      #{if (%{${Found} === 2})}
      This will not be printed
      Impossible Found: ${Found}
      #{end}
      

      The next following code doesn't work. We can't really protect the mapping to be used on conditions.

      #{if (%{true})}
      #{if (%{${Found} === 2})}
      #{end}
      This will be printed
      Tricky workaround Found: ${Found}
      #{end}
      

      The same problem also occurs while iterating, like the following example (take the set mapping as another issue key):

      &{for issues}
      ${set(Found,1)}
      Initial Found: ${Found}
      #{for i=JQLIssuesCount|clause=Key=${Found}}
      ${JQLIssues[i].Key}
      #{end}
      &{end}
      

      In this case, the

      ${Found}

      value below the

      #{for ...}

      isn't synched with the

      ${Found}

      value inside the

      #{for ...}

      on the same

      &{for issues}

      cycle.

      Attachments

        Issue Links

          Activity

            People

              sdrg sdrg
              mfda mfda
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: