How to obtain a list of attributes for a given RTC work item type via OSLC?
My problem, however, is that the the GET returns many oslc:property referring other properties, such as for example link types, of the work item type. For example, perform a GET on the RTC supplied defect work item type's rdf:resource https://<host>:<port>/ccm/oslc/context/_pyf14FrmEeWs66yN_e1diA/shapes/workitems/defect returns 115 oslc:property elements:
<rdf:RDF>So my question is how do I determine which work item type properties are for the work item type's attributes? Is there a better way of using RTC OSLC to obtain a given work item type's attributes?
<oslc:ResourceShape rdf:about="https://sport6.rtp.raleigh.ibm.com:9463/ccm/oslc/context/_pyf14FrmEeWs66yN_e1diA/shapes/workitems/defect">
<oslc:property>
<oslc:Property rdf:about="https://sport6.rtp.raleigh.ibm.com:9463/ccm/oslc/context/_pyf14FrmEeWs66yN_e1diA/shapes/workitems/defect/property/com.ibm.team.workitem.linktype.duplicateworkitem.duplicates">
<oslc:readOnly rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</oslc:readOnly>
<oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource"/>
<oslc:range rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<oslc:representation rdf:resource="http://open-services.net/ns/core#Either"/>
<oslc:propertyDefinition rdf:resource="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/com.ibm.team.workitem.linktype.duplicateworkitem.duplicates"/>
<oslc:valueShape rdf:resource="https://sport6.rtp.raleigh.ibm.com:9463/ccm/oslc/context/_pyf14FrmEeWs66yN_e1diA/shapes/workitems/defect"/>
<oslc:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
com.ibm.team.workitem.linktype.duplicateworkitem.duplicates
</oslc:name>
<oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-many"/>
<dcterms:title rdf:parseType="Literal">Duplicated By</dcterms:title>
</oslc:Property>
</oslc:property>
<oslc:property>
<oslc:Property rdf:about="https://sport6.rtp.raleigh.ibm.com:9463/ccm/oslc/context/_pyf14FrmEeWs66yN_e1diA/shapes/workitems/defect/property/com.ibm.team.enterprise.packaging.linktype.resultWorkItem.result">
<oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-many"/>
<dcterms:title rdf:parseType="Literal">Packaging Summary Work Item</dcterms:title>
<oslc:propertyDefinition rdf:resource="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/com.ibm.team.enterprise.packaging.linktype.resultWorkItem.result"/>
<oslc:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
com.ibm.team.enterprise.packaging.linktype.resultWorkItem.result
</oslc:name>
<oslc:readOnly rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</oslc:readOnly>
<oslc:range rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource"/>
<oslc:representation rdf:resource="http://open-services.net/ns/core#Either"/>
<oslc:valueShape rdf:resource="https://sport6.rtp.raleigh.ibm.com:9463/ccm/oslc/context/_pyf14FrmEeWs66yN_e1diA/shapes/workitems/defect"/>
</oslc:Property>
</oslc:property>
...
</oslc:ResourceShape>
</rdf:RDF>
I even tried performing a GET on the property's rdf:about, for example https://<host><port>/ccm/oslc/context/_pyf14FrmEeWs66yN_e1diA/shapes/workitems/defect/property/com.ibm.team.workitem.linktype.duplicateworkitem.duplicates, to see if this would return additional information. This GET failed with with an HTTP status of 404 Not Found. Shouldn't the property's rdf:about point to a valid entity?
3 answers
Comments
Comments
Just in case someone might find it useful, here is a Reportable REST API to list all custom attributes from a repository :
https://<repo_url>:<port>/ccm/rpt/repository/workitem?fields=workitem/projectArea/(name|itemId|extensionMetadata/(key|displayName|workItemType/*))
For the repository, this will list the custom attributes under each project area along with the work item type they belong to.
Sample output extract :
<projectArea>
<name>JKE Banking (Change Management)</name>
<itemId>_G3WWMHKEEeesP9BHAhBzgg</itemId>
<extensionMetadata>
<key>bv_el</key>
<displayName>bv_el</displayName>
<workItemType>
<id>defect</id>
<name>Defect</name>
</workItemType>
</extensionMetadata>