asddasdadas
3 answers
There are basically two CRUD APIs for ETM. See https://jazz.net/wiki/bin/view/Deployment/ELMProductAPILanding look into the ETM section and note the Reportable REST API. There is also an OSLC QM API. Ask an AI for the documentation.
The Reportable REST API is a bit simpler.
For the Reportable REST API you need to query for the items, you want to assign. See the link above and have a look.
I find the OSLC API more heavyweight, but it works. Follow the specification. The special thing with OSLC is the discovery process. https://rsjazz.wordpress.com/2022/02/22/ewm-oslc-query-api/ provides a hint how to use OSLC for querying. It is a different domain, but the mechanisms work the same.
Otherwise follow Ian. You need special headers for OSLC and you have to provide the configuration URI in case you have Configuration management enabled. The APIS are different, but the configuration-context headers are the same for both.
I should also mention the X-Jazz-CSRF-Prevent header that needs to set to the value of the JSESSIONID cookie for PUT and POST operation. You can get the JSESSIONID with a get Operation. There is the E-TAG Header and the if-Match Header that should be used. I also once ran into an issue, where I had to put an arbitrary User-Agent header with an arbitrary value, otherwise the POST would always fail. This was dependent on the default value of the user-value agent.
Last but not least, be sure you are authenticated. The Location header should not show "Authentication Required" or something like that. It would show the OSLC URI if the operation succeeded. In the Reportable REST API you get a slug to be able to retrieve the item, if successfully created. See the documentation.
Is a Reportable REEST API if at all at best. Not sure it does not look like:
Reportable RESTDocumentation: https://jazz.net/wiki/bin/view/Main/RqmApi does not look like https://<host>:<port>/ <contextRoot>/service/com.ibm.rqm.integration.service.IIntegrationService which is the root for the Reportable REST API entrypoint for queries.
Comments
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 08, 4:03 a.m."the referenced test case does not exist" says that your URL for the testcase isn't correct.
Paraschivoiu Alexandru
Apr 08, 4:22 a.m.The thing is that If I put that URL for the testcase I get 200 Response and valid XML data.
So it is not the testcase here what I think it could be that I may not properly give him the location where to look, that's why I ask maybe I'm missing something..
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 08, 10:28 a.m.If I do an OSLC Query for testcases, I get URLs like
i.e. none of the urn: stuff.
If I go to the testcase in ETM, on the dropdown menu for the testcase is a Copy link to Artifact option - that gives the same URL as above.
How did you discover your URL?
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 08, 10:32 a.m.Also make sure your POST has headers for Configuration-Context (with the configuration URL), OSLC-Core-Version: 2.0 and Accept: application/rdf+xml
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 08, 12:32 p.m.And I don't know where you got the URL you're POSTing to - that doesn't look like an OSLC creation factory URL.