How can I Obtain an Attachment ID Programmatically through the OSLC/REST API?
Our team is trying to determine the best way to obtain the attachment ID of an item that is posted via the API. We have no problem posting the attachment itself, but as far as we can tell there is no response info that contains the attachment ID of the item after we post it.
These are the steps that are currently being used by our team to obtain an attachment ID immediately after it is posted:
1. Use a GET request to get back a feed of all attachments
2. Find the URL for the last page of attachments
3. Use a GET request to obtain the last page of attachment
4. Search those results to get the attachment ID based on the name of the attachment
We are hoping for a much easier way to obtain an attachment ID. Ideally this would be indicated in the response, but it is not a requirement. We are just hoping for fewer steps to be able to obtain this ID -- perhaps based on name and/or other information that we would have on hand after posting an attachment.
Thanks!
One answer
https://jazz.net/forum/questions/150849/how-to-upload-an-attachment-to-a-work-item-via-rest-api
Comments
I am not using a two part approach to upload attachments, however I will look at this question and see if there's any information I can take away from it that will help me. Thank you for taking the time to answer me -- if it helps me get to my answer then I will come back and mark it as accepted.