I have a requirement to update Clearquest data from machines that do not have Clearquest installed. As such I am using the REST interface to update Clearquest data from such machines.
In order to update fields in Clearquest records you need to formulate XML to describe the record and which fields you are updating. Unfortunately different field types require different formats in the XML. For example:
<Projects><value rdf:resource="http://<server>/cqweb/oslc/repo/<DBSet>/db/<database>/record/16777895-35681818" oslc_cm:label="Island"/>
<value rdf:resource="http://<server>/cqweb/oslc/repo/<DBSet>/db/<database>/record/16777895-35681804" oslc_cm:label="Athena"/>
Simple field types like short_strings, ints etc. can be represented simply "<Deprecated>1</Deprecated>". But more complex field types like references and reference lists like Projects above require that you format out a URL that points to the referenced record.
So I need to know what type each field is. I have code that determines this already. However the record numbers in the URLs need also be computed. The 1677895 above represents the dbid of the record type or what is known in the Clearquest Designer as "Reference To". I also have code that will figure that out based on the record name.
So in the above example we have a VersionInfo stateless record that has a reference list field named Projects. However the problem is that Projects points to Project - not Projects.
So my question is, given the REST/OSLC interface, how do I determine what the Reference to record name (or dbid) is for a reference list (or a reference)?
This topic has been locked.
Pinned topic Determining the name of the record a reference points to using REST
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Leesa_Hicks 1200009HC4269 Posts
Re: Determining the name of the record a reference points to using REST2012-10-18T17:58:42ZThis is the accepted answer. This is the accepted answer.Not sure about the details of the REST URL, but you can ascertain the field type and what it refers to with EntityDef object methods, GetFieldDefType, GetFieldReferenceEntityDef
Re: Determining the name of the record a reference points to using REST2012-10-18T18:11:34ZThis is the accepted answer. This is the accepted answer.
- Leesa_Hicks 1200009HC4
For example, using REST one can read, change, delete Clearquest records from say a Linux machine who has never seen nor had installed any IBM/Rational Clearquest software at all! In such a situation there is no CQPerlExt to use, nor is there a cqperl or a ratlperl for that matter. This is the main reason and the main benefit of using REST to access Clearquest and it is a requirement for my task.
Another complication that forbids us from even installing IBM/Rational Clearquest on a Linux based machine is the fact that our Clearquest instance is (unfortunately) using Visual Basic for its action hook code. It is my understanding that since there is no Visual Basic for Linux, accessing a Clearquest instance whose action hook code is Visual Basic is not doable from a Linux machine that obviously does not have a Microsoft based Visual Basic with which to run the action hook code! So, in these circumstances REST is the only way to go (or write a daemon, which I've done before and which has its own set of issues).
pdubovitsky 100000N35Y376 Posts
Re: Determining the name of the record a reference points to using REST2012-10-19T13:02:38ZThis is the accepted answer. This is the accepted answer.Hello,
You can get this information from record shape.
Re: Determining the name of the record a reference points to using REST2012-10-19T14:01:01ZThis is the accepted answer. This is the accepted answer.