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

More ways to work with smart-values on Automation rules - ability to filter, reorder / sort, nest smart values

    XMLWordPrintable

Details

    • 2
    • 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.

    Description

      Suggested improvements

      • add a new function, sort() to manage smart value list items
      • accepts an attribute of the list to sort the list
        • Example: {{{{{}issue.fixVersions.sort(name)}}}}
      • accepts an optional parameter to control ascending or descending sorts, with a default value of ASC
        • Example: {{{{{}issue.fixVersions.sort(name, "DESC")}}}}
      • Bonus feature: multiple criteria can be specified for the sort order
        • Example: {{{{{}issue.fixVersions.sort(releaseDate, "DESC", name, "ASC")}}}}
      • Bonus feature: another smart value can be provided to describe the sort criteria
        • Example:
          • created variable of varSort = "name, 'DESC'" 
          • {{ {{issue.fixVersions.sort(varSort)}}}}

      Today is not possible to filter specific values through smart values. For example, it's not possible to get the last added attachment of an issue.

      https://codebarrel.atlassian.net/browse/AUT-1241

      Expected Results

      If you use smart values as, for example, {{issue.attachments.last.filename}}, this consider an A-Z order instead of the order in which the attachments were added to the issue.

      Actual Results

      It would be nice to be possible to filter values through smart values to get, for example, last added values of a field.

      Workaround

      There is no workaround at this moment.

      ***

      Using Automation for Jira, I'd like to nest smart values as follows:

      {{project.properties.issue.component}}
      

      Assuming a project property like this:

      {
      key: "Component A",
      value: "5caccd8a1608c412138787e3"
      }
      

      And also support complex JSON objects stored in entity properties, like so:

      {{project.properties.issue.component.approver2}}
      

      The project property would look like this:

      {
          key: "Component B",
          value: {
             "approver1": "5cc8aeebcbbec211ec62a0ec",
             "approver2": "5e7bf681dde7030c4f20dec6"
          }
      }
      

      But even better would be if we could have a single Project property with these mappings, like so:

      {
          key: "MappingList",
          value: {
              "Component A" : {
                     "approver1": "zyx",
                     "approver2": "wvu",
              },
              "Component B" : {
              "approver1": "abc",
                      "approver2": "xyz",
              },
                     "Component B" : {
                    "approver1": "def",
             "approver2": "ghi",
            },
            }
      }
      

      And we could reference it like this:

      {{project.properties."MappingList".{{issue.component}}.approver2}}

      Introducing nested smart values would be a great addition to be used in conjunction with the create lookup table feature. For example:

      {{Lookuptable.get("{{smartvalue}}")}}

      Attachments

        Issue Links

          Activity

            People

              89403358cf11 Charlie Gavey
              itrojahn@atlassian.com Ilenice
              Votes:
              72 Vote for this issue
              Watchers:
              34 Start watching this issue

              Dates

                Created:
                Updated: