It's all about the answers!

Ask a question

OSLC: Is it possible to access all attributes and their types for particular work item type?

Timur Markunin (6495165145) | asked Jul 03 '13, 10:46 a.m.

I'm trying to access work item type info:
- attributes
- attributes types
- enumerations

Is it possible via OSLC?

Accepted answer

permanent link
Dinesh Kumar B (4.1k413) | answered Jul 03 '13, 2:07 p.m.
Resource Shape is what I believe you are looking for which is reached following the discovery mechanism starting with rootservices of ccm.

let me explain from the Services URL obtained through the discovery mechanism:

GET on

with following headers
    OSLC-Core-Version: 2.0
    Accept: application/xml

and from the response locate the creation factory for the work item type you want to understand and you will see the resourceShape URL

        <dcterms:title rdf:parseType="Literal">Location for creation of Defect change requests </dcterms:title>
        <oslc:usage rdf:resource=""/>
        <oslc:usage rdf:resource=""/>
        <oslc:resourceType rdf:resource=""/>
        <oslc:resourceType rdf:resource="https://localhost:9443/ccm/oslc/types/_87qOEKvrEeKxU5AQolS52w/defect"/>
        <oslc:resourceShape rdf:resource="https://localhost:9443/ccm/oslc/context/_87qOEKvrEeKxU5AQolS52w/shapes/workitems/defect"/>
        <oslc:creation rdf:resource="https://localhost:9443/ccm/oslc/contexts/_87qOEKvrEeKxU5AQolS52w/workitems/defect"/>

perform a GET on the rdf:resource for oslc:resourceShape and you will see all the attributes of the work item type and the attriubtes data type and more (readonly, mandatory... )

here is a sample for Resolution Date of Defect Work Item Type:
    <oslc:Property rdf:about="https://localhost:9443/ccm/oslc/context/_87qOEKvrEeKxU5AQolS52w/shapes/workitems/defect/property/resolutionDate">
        <oslc:valueType rdf:resource=""/>       
        <oslc:readOnly rdf:datatype="">true</oslc:readOnly>
        <oslc:propertyDefinition rdf:resource=""/>       
        <oslc:occurs rdf:resource=""/>       
        <oslc:name rdf:datatype="">closeDate</oslc:name>       
        <dcterms:title rdf:parseType="Literal">Resolution Date</dcterms:title>

hope this helps...
Timur Markunin selected this answer as the correct answer

Bas Bekker commented Jul 29 '13, 10:44 a.m.

For a workshop on how to use the OSLC API, see this article Open Services for Lifecycle Collaboration Workshop

Geoff Alexander commented Sep 15 '15, 3:59 p.m.

I realized that this answer is fairly old.  But hopefully someone will answer my question. A GET on the rdf:resource for oslc:resourceShape does appear to return properties for all of the attributes.  But it also seems to return properties for other items such as link types.  So how do I determine which properties refer to attributes?

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.