Support for Attachment ID Mapping in Comment Media References via REST API

XMLWordPrintable

    • 4
    • 1

      • Lack of Direct Reference: The id property in the comment’s media object does not correspond to the attachment’s id property, making programmatic mapping unreliable.

      Proposed Solution

      • Enhance the REST API so that the media object in the comment references the actual attachment by its unique Jira attachment id, not just by filename.
      • For example, the comment’s media object could include:
         

       
      }{{ "type": "media",{{ "attrs": {}}{{ "type": "file",}}{{ "attachmentId": "10397", // direct mapping to attachment}}{{ ...}}{{ }}}

      • }

      • Alternatively, ensure that the existing id property in the media object matches the attachment’s id property.

      Benefits

      • Unambiguous Mapping: Developers can reliably map comment media to attachments, even if filenames are duplicated.
      • Robust Integrations: Reduces the risk of errors in automation, reporting, and integrations that process comments and attachments.
      • Future-Proof: Changes to filenames or other metadata will not break the mapping.

      References / Example

              Assignee:
              Unassigned
              Reporter:
              Erick Ivan
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: