It's all about the answers!

Ask a question

ClearQuest record field cannot be filled in using REST API OSLC 2.0


David Khetaguri (1114) | asked Feb 01 '16, 9:19 a.m.
I am trying to prefill ClearQuest record fields by using REST API OSLC 2.0. There are fields that are enabled after entering a product (field). Some fields that become enabled are not pre-filled with REST API call, even though they are specified.

Example:
Let's say that we have the following fields: A, B, C, D, E, F. In order to fill in field E, field B has to be filled in/selected. 

I now send a REST call to /cqweb/oslc/repo/OUR_REPO/db/OUR_DB/record-type/16777221/creationDialog?dc%3Atype=Defect with JSON formatted data like:

{
    "prefixes":{
      "dcterms":"http:\/\/purl.org\/dc\/terms\/",
      "cq":"http:\/\/www.ibm.com\/xmlns\/prod\/rational\/clearquest\/1.0\/"
    },
   "dcterms:type":"Defect",
   "cq:A": "A_DATA",
   "cq:B":"B_DATA",
   "cq:C":"C_DATA",
   "cq:D":"D_DATA",
   "cq:E":"E_DATA",
   "cq:F":"F_DATA"
}

I get status "201, Created" back and a URL in the Location header, but field E is not filled in (while A, B, C, D,F are). E is cq:readOnly="true" first and then becomes cq:required:"true" when B is filled in.

Also, E is filled in when creating (not-prefilling) the record through REST API (URL:/ cqweb/oslc/repo/OUR_REPO/db/OUR_DB/record). 

Am i doing something wrong or is it a bug? Any possible solution to fill in the field?

One answer



permanent link
Donald Nong (14.5k614) | answered Feb 01 '16, 6:13 p.m.
Not quite sure what do you mean "prefilling" in this context. When you use APIs, the interaction is completely different to the one when you use a browser.

The "creationDialog" URL should be used in a situation where you use a GUI - for example when you create a defect from within ClearTeam Explorer. This is not an "OSLC" API.

The second URL is the OSLC API. To ensure the fields are processed in the right order, follow the instructions in the below technote.
http://www-01.ibm.com/support/docview.wss?uid=swg21507620

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.