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

Automation Smart value iterations don't have access to the original issue variable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • None
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Issue Summary

      When iterating over a collection in smart values it would be useful to be able to access e.g. the original issue variable within the iteration.

      Steps to Reproduce

       

      {{#issue."Affected Status Page Components"}} "{{value.split("#").get(1)}}": "{{issue."Status Page Component Status"}}"{{^last}}, {{/}}{{/}} 

       

      Expected Results

      Expect to be able to access the `issue` variable

      Actual Results

      Returns an empty string rather than the issue variable

      Workaround

      The expression can sometimes be re-formed as a mapping over the collection rather than an iteration:

       

      {{issue."Affected Status Page Components".value.split("#").get(1).concat(":").concat(issue."Status Page Component Status")}} 

       

            [AUTO-490] Automation Smart value iterations don't have access to the original issue variable

            @Bill Sheboy
            I've reported this as bug in support ticket and they reopened this one.
            Hope they will add this feature soon.

            Jakub Pielużek added a comment - @Bill Sheboy I've reported this as bug in support ticket and they reopened this one. Hope they will add this feature soon.

            I noticed this "suggestion" was re-opened, so does that mean the Atlassian team will try working on it again?

            My understanding from community posts was they have tried to fix the iterator scope problem several times without success.

            Thanks!

            Bill Sheboy added a comment - I noticed this "suggestion" was re-opened, so does that mean the Atlassian team will try working on it again? My understanding from community posts was they have tried to fix the iterator scope problem several times without success. Thanks!

            Actually, this is a larger scope issue (no pun intended :^)

            Inside of an iterator, rules can only access attributes at the iterator's source and lower.  That includes anything above that scope, or in other objects: issues, variables, tables, etc.

            Work-arounds for this are either to use a web request and perform operations outside of the rule with external code, or (for limited use cases) expand the iterator's data into a created variable and then use text functions such as match() to do so...followed by split() to expand back into a list.

            Bill Sheboy added a comment - Actually, this is a larger scope issue (no pun intended :^) Inside of an iterator, rules can only access attributes at the iterator's source and lower.  That includes anything above that scope, or in other objects: issues, variables, tables, etc. Work-arounds for this are either to use a web request and perform operations outside of the rule with external code, or (for limited use cases) expand the iterator's data into a created variable and then use text functions such as match() to do so...followed by split() to expand back into a list.

              Unassigned Unassigned
              jnavin James Navin
              Votes:
              8 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: