Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-3956

Get all attachment info from the attachment manager when rendering mail items

    Details

    • Type: Bug
    • Status: Triage
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: 5.6.2
    • Fix Version/s: None
    • Labels:
      None
    • Critical Points:
      0.5

      Description

      When the custom email script adds attachments to the mail it creates, in some places it gets the list of attachments from the AttachmentManager, and in others uses the getAttachments() method of the issue object in the bindings. The problem with the latter method is that its results can fall out-of-date with those from AttachmentManager, and so newly-added attachments (e.g. as part of the same workflow transition) may not be present there. This is specifically troublesome because there are points where the script tries to pick out elements of the list from getAttachments() based on the elements of the list from AttachmentManager: since the latter list may contain elements that the former lacks, this can produce null results that are not checked for and thus lead to NPEs later on.

      For consistency and freshness' sake, therefore, we should use AttachmentManager wherever possible.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            jchoules Joanna Choules
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: