It's all about the answers!

Ask a question

delete or update a relatedArtifact link via Rest Api

Roger Layani (5313238) | asked Feb 04 '15, 3:26 a.m.
 I am trying to delete or update a work item related artifact link using rest api.
for this I use a partial representation with cmd:
$CURL -s -k  -b $COOKIES -o $file "${HOST}/oslc/workitems/$id/

I get the list of artifact related links of the work item in short xml file

Now I replace or delete the relevant line relative to link I want to update/delete

and return new updated file by

$CURL -v -S -D - -k -b $COOKIES  -H \"Content-Type: application/x-oslc-cm-change-request+xml\" -H \"Accept: application/x-oslc-cm-change-request+xml\" -X PUT --data-binary \@$outfile $URL

the return response has HTTP/1.1 200 OK message code.

but nothing happen, in the work item the link still exists.
someone has an idea what I did wrong?

One answer

permanent link
sam detweiler (12.5k6194201) | answered Feb 04 '15, 7:22 a.m.
edited Feb 04 '15, 7:22 a.m.
you cannot 'update' a link.. it is a unique object with unique endpoint objects.. you can delete one and create another.. even another with the same start and end beomes a unique object in the repository database.

I do not know how to do this with rest apis

Your answer

Register or to post your answer.