Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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! 

0 votes



One answer

Permanent link
Check out this post. It appears that after you call the com.ibm.team.workitem.service.internal.rest.IAttachmentRestService service, you should get an UUID for the newly upload attachment. And from there, you can get the identifier of the attachment. Not sure whether you are using the same two steps to upload attachment though.
https://jazz.net/forum/questions/150849/how-to-upload-an-attachment-to-a-work-item-via-rest-api

1 vote

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.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: May 28 '14, 1:06 p.m.

Question was seen: 3,821 times

Last updated: May 30 '14, 5:36 p.m.

Confirmation Cancel Confirm