How to obtain a list of attributes for a given RTC work item type via OSLC?
![]()
I need to get the list of attributes, both built-in attributes and custom attributes, for a given RTC work item type via OSLC? The jazz.net forum topic OSLC: Is it possible to access all attributes and their types for particular work item type? says that performing a GET on the rdf:resource for oslc:resourceShape from the work item type's oslc:creationfactory returns the work item type's attributes as oslc:property. I've found this to the be the case.
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? 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
![]()
The 115 properties that you got are all for work item type "Defect", as indicated in the URL. If you get the same for Task, there are only 105 Properties. About the 404 Not Found error, I don't think there are any further shapes to be obtained, since the property definition is already in the XML document that you have got.
Comments Donald, I realize that the 115 properties are for the work item type "Defect". My question is how do I determine which of the 115 properties are for Defect attributes?
Do you mean attributes unique to Defect when you say "Defect attributes"? I don't know how you would define such a term. You can find the name space of the property in the <oslc:propertyDefinition> tag - probably that's what you are looking for?
The problem I have is that I need to programmatically determine which properties reference attributes. I'm not sure what you mean by name space of the property in the <oslc:propertyDefinition> tag. I don't see anything in the <oslc:propertyDefinition> tag that clearly identifies a property as referencing an attribute. For example, how do I programmatically determine if the property containing
<oslc:propertyDefinition rdf:resource="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/teamArea"/> As for the 404 error when performing an HTTP GET on the property's about URI, I'll investigate further and open a defect if I believe that it's an actual RTC / JTS bug. OK. I think I now understand what you are talking about. :-)
Yes, I'm trying to obtain via RTC OSLC the list of attributes for a work item type as shown in the RTC Eclipse client's project area editor on the Project Configuration tab under Project Configuration -> Configuration Data -> Work Items -> Types and Attributes in the Attributes section. Are you saying that it's not possible to obtain this attribute list via RTC OSLC?
I don't think it's possible. The separation of "attributes" from other "properties" is not part of the OSLC specification. You can use some internal API (/ccm/service/com.ibm.team.workitem.service.process.internal.rest.IWorkItemConfigRestService/workItemTypes) if you really have to.
I tried doing an HTTP GET on /com.ibm.team.workitem.service.process.internal.rest.IWorkItemConfigRestService/workItemTypes and received the following server error:
I've opened RTC Defect 371032 for the AFE server error I reported in my previous comment. The defect contains the full stack trace.
I used the AFE stack trace to debug the AFE. It turns out that the AFE was because I didn't specify a projectAreaItemId parameter in the GET request. The correct URI syntax is
showing 5 of 9
show 4 more comments
|
![]()
Hi Geoff,
I might not understand what you're going for here, but it seems to me that you're getting a list of all the work item attributes. Team Area, for example, is an attribute of a work item because work items need to reference their team areas.
Possibly you're looking for a particular set of attributes, such as attributes that are directly modifiable by the user?
Comments This list of work item type properties includes more than just attributes such as
<rdf:Description rdf:about="https://sport6.rtp.raleigh.ibm.com:9463/ccm/oslc/context/_pyf14FrmEeWs66yN_e1diA/shapes/workitems/defect/property/com.ibm.team.enterprise.promotion.linktype.promotionBuildResult.promotionBuildResult">For example, 115 properties are returned for the defect work item type. However the defect work item type only has 29 attributes as shown in the project area editor in the RTC Eclipse client. Hy Geoff, it mitght be a little late, but I guess this might be the solution you're searching for:
|
![]() Just in case someone might find it useful, here is a Reportable REST API to list all custom attributes from a repository :
|
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.