Uploaded image for project: 'Automation for Jira Server'
  1. Automation for Jira Server
  2. JIRAAUTOSERVER-1072

Unexpected behavior for "Edit issue" action with List fields depending on number of elements

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 7.4.2, 9.0.4, 8.2.5
    • Severity 3 - Minor

      Issue Summary

      Smart values do not work well in the "Edit Issue" action when trying to set a list type field (such as Components, Fix Versions) under some condition.

      For example, if the Components field is set through the Choose fields to set... option, the syntax below will copy an empty value if the Components from the Trigger Issue has multiple values:

      {{#triggerIssue.components}}{{name}}{{/}}
      

      Steps to replicate

      1. In a Jira Software project, create an Epic and a Story, and link the Story to the Epic issue via the Epic Link field
      2. Add 2 components to the Epic issue, as shown below:
      3. Create an automation rule as described below:
        • Trigger: "Manually Triggered"
        • Branch: "For Stories (or other issues in Epic)"
        • Add the action "Edit Issue" inside the branch, with the configuration below
          • Choose Fields to set...: Select the Components field
          • Add the syntax below:
            {{#triggerIssue.components}}{{name}}{{/}}
            
        • The rule will look like below:
      4. Open the Epic issue, and trigger the rule manually via the More menu
      5. Open the Story issue

      Expected behavior

      The Story should inherit from the 2 components of the Epic, as per the automation rule configuration:

      Actual behavior

      The Story does not have any component set

      Notes

      If the Epic issue only had 1 single component, the rule would have worked and the story would be set with the same component

      Workaround

      Workaround 1 - Using the "Choose fields to set..." option

      Instead of using a smart value to set the Components field, use the option Issue to copy value from and set it to Trigger Issue.

      Workaround 2 - Using the "Additional fields" option

      Copy the payload below in the Additional Fields option:

      {
      	"fields": {
        		"components": [
        	    	    {{#triggerIssue.components}}{"name":"{{name}}"}{{^last}},{{/}}{{/}}
        		]
       	} 
      }
      

        1. ConfigurationOfFailingRule.png
          ConfigurationOfFailingRule.png
          237 kB
        2. EpicIssue.png
          EpicIssue.png
          137 kB
        3. StoryIssue.png
          StoryIssue.png
          135 kB
        4. Workaround1.png
          Workaround1.png
          267 kB
        5. Workaround2.png
          Workaround2.png
          293 kB

              Unassigned Unassigned
              jrey Julien Rey
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: