It's all about the answers!

Ask a question

Create Project Area in DNG via OSLC REST Apis


0
3
Avery Granum (3115) | asked May 24 '17, 10:55 a.m.

Hi,

I'm looking for a way to programmatically create a project area in DNG but I have not found instructions on how this can be achieved.  I've found sets of tips for CLM versions several major versions ago. 

https://jazz.net/wiki/bin/view/Main/DraftTeamProcessRestApi?sortcol=3;table=3;up=0#POST_project_areas_collection

This seems to be the closest instruction I can find, however my post is returning a 201 Created status (success) but I then cannot view that project area in the DNG web UI.

Any tips or hints for me?

-Avery

2 answers



permanent link
Jim Ruehlin (79114) | answered May 24 '17, 1:15 p.m.
JAZZ DEVELOPER

 That's the correct API call and it's returning the correct response. Do you have permission to view the project area? And did you use a valid template (I'd think it would return an error if you didn't but it might be worth checking). Can you find the project via the REST API via Project Area Collections? https://jazz.net/wiki/bin/view/Main/DraftTeamProcessRestApi?sortcol=3;table=3;up=0#Project_Areas_collection


Comments
Avery Granum commented May 24 '17, 4:14 p.m. | edited May 24 '17, 4:59 p.m.

As for permission to view:  My user is a JazzAdmin at the JTS level, so I assume it should have permissions to view project areas as I can see all the project areas created by myself and others while using the web UI (this does not include the projects I've received 201 Created status via REST apis)

For better context I've performed a POST to <mydnghost>/rm/oslc_rm/catalog with the following body:
<?xml version="1.0" encoding="UTF-8"?>
<jp06:project-area xmlns="<mydnghost>/rm/" name="MyDNGTest" templateId="RRSTemplateID" jp06:templateLocale="en_US">;
    <jp06:summary>For testing with REST Client</jp06:summary>
    <jp06:description>None</jp06:description>
    <jp06:visibility jp06:access="PUBLIC"/>;
</jp06:project-area>


The response header includes a location header with a URI that returns a 404 not found exception when supplying it with a GET. 


Donald Nong commented May 25 '17, 6:39 a.m.

The returned "location" looks quite funny - it is like "https://clm603.example.com:9443/rm/linkTypes/_BPLCoUE1EeeiU_FP2rtfzg". So it is definitely incorrect. I'm pretty sure the namespace being used is incorrect, but I don't know what should be used, yet.


Avery Granum commented May 25 '17, 11:04 a.m.

Thanks for the tip Donald, I've double checked the documentation and noticed the namespace:

I've retried the POST call with both namespaces and gotten the same 201 Created response with the linkTypes uri for the resource location.  So unfortunately it looks like the same false positive response.



permanent link
Jim Ruehlin (79114) | answered May 31 '17, 11:41 a.m.
JAZZ DEVELOPER

 I don't see a <visibility> tag in your request body. I don't know what this value defaults to. If you login as something other than a JAZZ_ADMIN and the "access" param is not "public", you wouldn't see the projects. Are you logging into the web UI as a JAZZ_ADMIN or as the user from the auth header of your POST? See the request body example of the POST from the link you provided.

Your answer


Register or 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.