Creating a Work Item in RTC/RQM 4.0 using OSLC REST API Pragmatically in Java
Hi ,
I have tried to explore the OSLC API in java by following the OSLC Workshop 2012-11-26-OSLC-workshop.pdf
Now I want to create a Work Item using my java code to RTC 4.0 or RQM 4.0 but i didn't found the much documentation and example in the same.
I found some links related to this in Jazz.net but those are outdated.
Can anyone guide/help me regarding this issue?
7 answers
To create Work Item, you'd have to either use CreationDialog (provides delegated UI from RTC to create WI) or CreationFactory (where you'd do a POST to the CreationFactory URI with whatever content needs to go into your WI) service.
I've not tried the workshop myself, so I don't know if there's any sample in there. To understand how to use CreationDialog or CreationFactory, you can refer to the following article:
Hope that helps.
For the OSLC QM V2 API in RQM, see https://jazz.net/wiki/bin/view/Main/RqmOslcQmV2Api.
Comments
Hi Rahul,
it's a good point you've already experienced the OSLC workshop.
As you've figured out already, it misses an RQM-related section. For the moment (but there are plans to add such subpart to it). In the meanwhile, you've a starting point (code for auth, etc. )
In addition to the RQM wikis (providing extensive information and already pointed out to you by Paul), you could check sample-based "cheat sheets" / "How Tos" provided in this blog:
http://sleroyblog.wordpress.com/2013/04/09/querying-rqm-40-through-oslc-and-rest-api/
Regards,
Stéphane
it's a good point you've already experienced the OSLC workshop.
As you've figured out already, it misses an RQM-related section. For the moment (but there are plans to add such subpart to it). In the meanwhile, you've a starting point (code for auth, etc. )
In addition to the RQM wikis (providing extensive information and already pointed out to you by Paul), you could check sample-based "cheat sheets" / "How Tos" provided in this blog:
http://sleroyblog.wordpress.com/2013/04/09/querying-rqm-40-through-oslc-and-rest-api/
Regards,
Stéphane
Rahul,
See if this article offers any help: https://issues.apache.org/jira/browse/HTTPCLIENT-896. It looks like the "Expires" value for your cookie is not in a valid format (for whatever reason) and this article provides some steps in the comments to workaround.
See if this article offers any help: https://issues.apache.org/jira/browse/HTTPCLIENT-896. It looks like the "Expires" value for your cookie is not in a valid format (for whatever reason) and this article provides some steps in the comments to workaround.
Mike Jaworski
Hi Eric,
It works fine after adding the header [X-Jazz-CSRF-Prevent] value as current JSESSIONID for me.
reference: https://jazz.net/forum/questions/98072/x-jazz-csrf-prevent-header-is-required-to-create-a-work-item-via-oslc-on-version-4001
i.e postRequest.addHeader("X-Jazz-CSRF-Prevent","
It works fine after adding the header [X-Jazz-CSRF-Prevent] value as current JSESSIONID for me.
reference: https://jazz.net/forum/questions/98072/x-jazz-csrf-prevent-header-is-required-to-create-a-work-item-via-oslc-on-version-4001
i.e postRequest.addHeader("X-Jazz-CSRF-Prevent","
AAAACF37530880CEE8034FD5A890453F")
You can also try to make a POST request via REST Client add-on in Firefox.
Comments
In RDNG(6.0.1 M2 in my cases) when you try to create new requirement no matter how REST client(like POSTMAN) or using Eclipse Lyo if you do not specify tititle of the requirement as well as the instanceShape the result is 403 Forbiden. So you can omit the nav:parent, but title and instanceShape are mandatory.
So my request (working ) is :
Content-Type: application/rdf+xml
So my request (working ) is :
<rdf:RDFxmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns:dc="http://purl.org/dc/terms/"xmlns:public_rm_10="http://www.ibm.com/xmlns/rm/public/1.0/"xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"xmlns:acp="http://jazz.net/ns/acp#"xmlns:rm_property="https://grarrc.ibm.com:9443/rm/types/"xmlns:oslc="http://open-services.net/ns/core#"xmlns:nav="http://jazz.net/ns/rm/navigation#"xmlns:oslc_rm="http://open-services.net/ns/rm#" ><rdf:Description rdf:about=""><rdf:type rdf:resource="http://open-services.net/ns/rm#Requirement"/><dc:description rdf:parseType="Literal">OSLC Creation Example 2</dc:description><dc:title rdf:parseType="Literal">OSLC Created Requirement 2</dc:title><dc:contributor rdf:resource="https://10.0.2.79:9443/jts/users/Admin"/><oslc:instanceShape rdf:resource="https://10.0.2.79:9443/rm/types/_opYnsUZsEeWL2aNIq4SA-w"/><nav:parent rdf:resource="https://10.0.2.79:9443/rm/folders/_4du-YEDTEeW98vRabXRPEQ"/></rdf:Description></rdf:RDF>with header :
Content-Type: application/rdf+xml
Comments
Eric Lemes
Oct 12 '17, 10:05 a.m.