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

      Current behavior:
      The smart value {{attachment.id}} fetches attachments' IDs in alphabetical order and not by the latest (or last attachment) that was added.

      Consider a scenario where 3 attachments are added to the issue:

      1. "1_2025-01-09T13_21_16.962Z.png"
      2. "asset object.jpg"
      3. "zeeattach.png"

      When you print {{attachment.last.id}} smart value using 'Log action' in an Automation rule with 'Issue commented' trigger, it will give the ID of the "zeeattach.png" and {{attachment.first.id}} will give the ID of "1_2025-01-09T13_21_16.962Z.png".

      Expected behavior:
      The smart values {{attachment.last.id}} and {{attachment.first.id}} should fetch the attachment IDs according to the date and time they were added to the issue.

            [AUTO-1653] Improve {{attachment.id}} smart value

            Greetings!

            In my opinion, making changes to the behavior of attachment list ordering without a holistic investigation and change to list ordering seems like a very bad idea, potentially breaking many customers' existing rules.

            There is nothing in the documentation defining list order, and it can only be (possibly) relied upon for the Lookup Issues action with JQL containing an ORDER BY clause.  All other references do not have list order information:

            For the scenario described in this suggestion, there are two possible workarounds:

            1. use the min and max functions with the id attribute, rather than the first and last functions on the list order: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/#list.max 
            2. use dynamic list searching techniques (and regular expressions) on the created attribute to find the first or last, and then extract / parse the needed record: https://community.atlassian.com/t5/Automation-articles/Automation-concepts-Dynamic-searches-within-a-list/ba-p/2834235 

            Kind regards,
            Bill

            Bill Sheboy added a comment - Greetings! In my opinion, making changes to the behavior of attachment list ordering without a holistic investigation and change to list ordering seems like a very bad idea, potentially breaking many customers' existing rules. There is nothing in the documentation defining list order, and it can only be (possibly) relied upon for the Lookup Issues action with JQL containing an ORDER BY clause.  All other references do not have list order information: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--attachment-- https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/ And even the latest version of the Lookup Table has non-deterministic behavior for ordering, such as with the entries function: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Create-lookup-table   For the scenario described in this suggestion, there are two possible workarounds: use the min and max functions with the id attribute, rather than the first and last functions on the list order: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/#list.max   use dynamic list searching techniques (and regular expressions) on the created attribute to find the first or last, and then extract / parse the needed record: https://community.atlassian.com/t5/Automation-articles/Automation-concepts-Dynamic-searches-within-a-list/ba-p/2834235   Kind regards, Bill

              Unassigned Unassigned
              3033da771e98 Ashutosh Sharma
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: