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

Add/Append related artifacts to Workitem

 Hi everyone,

i need to append to a workitem some related artifacts using curl rest api. i'm able to add a related artifacts using a command like this:

 curl -D - -k -b $COOKIES -c $COOKIES -H "Content-Type: application/x-oslc-cm-change-request+json" -H "Accept: application/json" -X PATCH -d '{"rtc_cm:com.ibm.team.workitem.linktype.relatedartifact.relatedArtifact": {"rdf:resource":"'$BUILDPATH'","oslc_cm:label":"Included in Build: '$BUILD'"} }' $HOST/oslc/workitems/$WORKITEM/

but if i call again this api the new value override the old one. 
There is a way to append the new value insted of rewrite the all "related artifacts" property.
i'm new in rtc api usage so hope this question doesn't sounds stupid :).

Thanks.  



0 votes



One answer

Permanent link

 You have to first retrieve all related artifacts, then add your new ones and save them all together.

0 votes

Comments

 The problem is that i cant retrieve all artifacts at the same time. So i need a way to add a new one later

 

is there a documentation about curl api? 

That is how the API works. You GET the representation of the resource, you add, modify or remove stuff, then you PUT the result. If you just put one relationship, all the existing ones are deleted.

CURL is an application, bot an API. CURL allows to use REST or HTML APIs.

http://open-services.net/bin/view/Main/CmSpecificationV2 is the API specification for the OSLC REST API. 

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
× 485
× 62

Question asked: Aug 24 '18, 5:02 a.m.

Question was seen: 3,074 times

Last updated: Aug 24 '18, 8:15 a.m.

Confirmation Cancel Confirm