IBM Support

Specifying a query with the ClearCase Change Management Interface (CMI) configured for ClearQuest

Question & Answer


Question

How do you specify the query URI for ClearQuest queries in the ClearCase Change Management Interface (CMI) configured for ClearQuest?

Answer

ClearQuest queries can be defined on

  • A branch type's CMI provider configuration for the base ClearCase integration with ClearQuest
  • A stream's CMI provider configuration for the ClearCase UCM integration with ClearQuest

The queries return ClearQuest record results from a specified ClearQuest web server through OSLC. The only supported query format for ClearQuest clients is a static Open Services for Lifecycle Collaboration (OSLC) query. Dynamic (that is, interactively specified) queries and customized OSLC queries are not supported. (For a discussion of customized OSLC queries, refer to https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014785045.)

Specifying the query URI

The ClearQuest query URI is specified in the CMI provider configuration with the queryuri keyword, which takes the form

queryuri:baseurl/repositorydbset/database/user_database/query_pname

for example,

queryuri:http://cqserver1.com/cqweb/oslc/repo/CQWAN/db/SAMPL/query/?rcm.name=Pub…

where:

ComponentValue
baseurlhttp://cqserver1.com/cqweb/oslc
repository/repo
dbset/CQWAN
database/db
user_db/SAMPL
query_pname/query/?rcm.name=Public%20Queries/All%20Defects

This form of the queryuri explicitly specifies the connection (the base URL), the repository, dbset, and so on, but the connection and database information can also be established by specifying them in a mkcmprovider operation (refer to the descriptions of the -connection and -context options in the mkcmprovider reference page (http://www-01.ibm.com/support/knowledgecenter/SSSH27_8.0.1/com.ibm.rational.clearcase.cc_ref.doc/topics/ct_mkcmprovider.htm)). In that case, you can specify the queryuri as

queryuri:rcm.name=Public%20Queries/All%20Defects

Note that
  • You can test the full query URL in a web browser to ensure it is valid, and then replace with the short form, if you wish.
  • Space characters (%20) and any other special characters must be encoded in the URL.
  • The rcm.name parameter is required for all supported ClearQuest queries.
  • The queryuri key word is case-sensitive (lower-case for CMI configured for ClearQuest).

Configuration for base ClearCase

For the Base ClearCase configuration, the queryuri is specified for the branch type; for example,

cleartool mkcmprovider -brtype main@VOB_NAME -context userdb:SAMPL,dbset:CQWAN,"queryuri:http://cqserver1.com/cqweb/oslc/repo/CQWAN/db/SAMPL/query/?rcm.name=Pub…" CQ_PROV1

or

cleartool mkcmprovider -brtype main@VOB_NAME -context userdb:SAMPL,dbset:CQWAN,"queryuri:rcm.name=Public%20Queries/All%20Defects" CQ_PROV1

Note that the query section of the mkcmprovider command is enclosed by quotation marks.

Configuration for UCM

For the UCM configuration, the queryuri is specified for the stream; for example,

cleartool mkcmprovider -stream STREAM_NAME@VOB_NAME -context userdb:SAMPL,dbset:CQWAN,"queryuri:http:cqserver1.com/cqweb/oslc/repo/CQWAN/db/SAMPL/query/?rcm.name=Public%20Queries/All%20Defects" -enable "true" CQ_PROV1

or

cleartool mkcmprovider -stream STREAM_NAME@VOB_NAME -context userdb:SAMPL,dbset:CQWAN,"queryuri:rcm.name=Public%20Queries/All%20Defects" -enable "true" CQ_PROV1



Selecting the query

The query that you select must be visible and executable by all users who are to perform operations on the branch or stream on which CMI is configured. In ClearQuest, the default query folders =in the navigator are "Public Queries" and "Personal Queries." Because personal queries are private to individual users, always specify a query in the "Public Queries" folder.

Running a Change Management Provider's Query

In base ClearCase, once a ClearQuest query URI is specified for the Change Management Provider, it can be used by running a cleartool settask -find command. The results from the query are presented in the following format:

Record ID@Provider Name: Headline
Record ID@Provider Name: Headline
.
.
.

In UCM, a ClearQuest query URI can be used by running a cleartool lsactivity -find command, with results in the same format as shown above.

[{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Integrations","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF015","label":"IRIX"},{"code":"PF016","label":"Linux"},{"code":"PF022","label":"OS X"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.0.0.7;8.0.1;8.0.1.8","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
08 August 2018

UID

swg21641363