Hi,
I have a scenario like when a comment with attachment is created in Jira I need to add a comment with that attachment in 3rd party application. In this process when a comment is created with an attachment in Jira I'm getting attachment details in the comment body itself. How I can get separate details of attachments when added in a comment.
Thanks.
Hi,
I see that you are looking to use the REST API in order to determine when an attachment was added in a comment. Technically this is not something that I expect the REST API to be able to tell you (at least not in a single call).
The main reason is that attachments in Jira are bound to the specific issue in question, and not directly to the comment that sits under that issue. So while, yes you can refer to an attachment in a comment, in order to do so, technically that attachment has to exist on the Jira issue first and that attachment is only use a reference link such as !filename.jpg|thumbnail! or alike. The web interface that end users will use tries to make this as seamless as possible, letting users attach that file in the comment text editor directly.
However using the REST API within Jira to pull back comments, does not tell us specifically if that file was on the issue before the comment, or was added when the comment was posted. Only a careful examination of the attachment created time, can tell us when it was added to the issue. Perhaps using the endpoint of GET /rest/api/3/attachment/{id} could at least return the metadata about that attachment (not the attachment itself). From there you could then compare to see if perhaps you can match up the time a comment was made. I know this seems clunky, but I don't believe there is a single REST API call you can make in order to get back exactly what you have asked for here.
Does this help? If not, please let me know about what you are trying to do here, perhaps if I can better understand I can offer a different work-around.
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.