-
Type:
Suggestion
-
Resolution: Unresolved
-
Component/s: Work Item - Attachments
-
None
-
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
- Comment API:
GET https://yourdomain.atlassian.net/rest/api/3/issue/ET-14/comment
- Attachment API:
GET https://yourdomain.atlassian.net/rest/api/3/issue/ET-14?fields=attachment