It's all about the answers!

Ask a question

How do I add subscribers to a work item via the REST API?


0
1
Andrew Trobec (48712125136) | asked Jan 21 '14, 10:31 a.m.
edited Jan 21 '14, 11:08 a.m. by Krzysztof Kaźmierczyk (7.2k34279)
Hello,

I am developing a C# REST client for RTC 4.0.0.1 and I am trying to find out how to add subscribers to a work item.  I have already read this thread and this enhancement request but I cannot seem to get my head around the process.

When creating a work item I have the following subscriber property:
<rtc_cm:subscribers oslc_cm:collref="https://<server>/ccm/oslc/workitems/__CupL39eEeOeYOj8IKVRng/rtc_cm:subscribers"/>

What I am trying to do is perform a POST/PUT directly to that address.  Is this the right approach?  All of my attempts result in a 405: Method Not Allowed response, so maybe my XML file is being formatted with the wrong headers?  Which ones should I be using?

Thank you and best regards,

Andrew

Accepted answer


permanent link
Krzysztof Kaźmierczyk (7.2k34279) | answered Jan 24 '14, 9:35 a.m.
Hi Andrew,
You can check this post: https://jazz.net/forum/questions/98302/oslc-how-to-remove-subscribers-with-oslc. Despite it is about opposite action, it can work for you as well.
Andrew Trobec selected this answer as the correct answer

Comments
Andrew Trobec commented Jan 28 '14, 3:24 a.m.

@krzysztofkazmierczyk

This is the perfect example to put me on the right track, thanks!
Andrew

One other answer



permanent link
Krzysztof Kaźmierczyk (7.2k34279) | answered Jan 21 '14, 11:07 a.m.
Hi Andrew,
Just look at my nice answer I have provided some time ago: https://jazz.net/forum/questions/135858/how-to-perform-particular-action-using-rest-api-in-clm-applications

Let us know if it helps.

Comments
Andrew Trobec commented Jan 22 '14, 2:17 a.m.

@krzysztofkazmierczyk

Thank you for the reply.
I have tried to follow your instructions, but the POST command is using JSON and it seems that the calls are made to the JAVA API.
Have you managed to either add subscribers or add links using the REST API?
Best regards,
Andrew

Your answer


Register or to post your answer.