REST API - Return a specific Work Item number with Tested By Test Case and Implements Requirements Links
2 answers
Hi Aaron, try:
/rpt/repository/workitem?fields=workitem/workItem[id=2]/(id|summary|projectArea/name|creator/name|auditableLinks/*/*)
The above will give you the raw URLs to the linked resources. Please exlplore the XSD schema and post questions if you get stuck.
Comments
I receive an error "Error 500: CRRED0108E: Illegal fields argument. workitem/workItem/auditableLinks is not a valid field name."
I can list the auditableLinks - such as
rpt/repository/workitem?fields=workitem/auditableLink[name='com.ibm.team.workitem.linktype.testedByTestCase']/*/*
See the next comment for the schema information - due to the limitations of the number of characters of this comment box.
We are using CLM 4.0.2
When I look at the schema ... I didn't see how to include auditableLinks
/rpt/repository/workitem?metadata=schema
<xs:complexType name="com.ibm.team.workitem.WorkItem">
<xs:sequence>
<xs:element type="xs:string" name="uniqueId"></xs:element>
<xs:element type="xs:string" name="stateId"></xs:element>
<xs:element type="xs:string" name="itemId"></xs:element>
<xs:element type="xs:string" name="contextId"></xs:element>
<xs:element type="xs:time" name="modified"></xs:element>
<xs:element type="xs:string" name="predecessor"></xs:element>
<xs:element type="xs:integer" name="id"></xs:element>
<xs:element type="xs:time" name="resolutionDate"></xs:element>
<xs:element type="xs:string" name="summary"></xs:element>
<xs:element type="xs:time" name="creationDate"></xs:element>
<xs:element type="xs:time" name="dueDate"></xs:element>
<xs:element type="xs:string" name="description"></xs:element>
<xs:element type="xs:string" name="workflowSurrogate"></xs:element>
<xs:element type="xs:string" name="tags"></xs:element>
<xs:element type="xs:long" name="duration"></xs:element>
<xs:element type="xs:long" name="timeSpent"></xs:element>
<xs:element type="xs:long" name="correctedEstimate"></xs:element>
<xs:element type="xs:date" name="dayModified"></xs:element>
<xs:element type="xs:integer" name="commentCount"></xs:element>
<xs:element type="xs:integer" name="subscriberCount"></xs:element>
<xs:element type="xs:string" name="formattedSummary"></xs:element>
<xs:element type="xs:string" name="formattedDescription"></xs:element>
<xs:element type="xs:string" name="stringComplexity"></xs:element>
<xs:element type="xs:integer" name="integerComplexity"></xs:element>
<xs:element type="xs:float" name="floatComplexity"></xs:element>
<xs:element type="xs:long" name="longComplexity"></xs:element>
<xs:element type="xs:double" name="doubleComplexity"></xs:element>
<xs:element minOccurs="1" type="com.ibm.team.repository.Contributor" maxOccurs="1" name="modifiedBy"></xs:element>
<xs:element minOccurs="1" type="com.ibm.team.repository.Contributor" maxOccurs="1" name="creator"></xs:element>
<xs:element minOccurs="1" type="com.ibm.team.repository.Contributor" maxOccurs="1" name="owner"></xs:element>
<xs:element minOccurs="1" type="com.ibm.team.workitem.Category" maxOccurs="1" name="category"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.Comment" maxOccurs="unbounded" name="comments"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.Attribute" maxOccurs="unbounded" name="customAttributes"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.repository.Contributor" maxOccurs="unbounded" name="subscriptions"></xs:element>
<xs:element minOccurs="1" type="com.ibm.team.process.ProjectArea" maxOccurs="1" name="projectArea"></xs:element>
<xs:element minOccurs="1" type="com.ibm.team.repository.Contributor" maxOccurs="1" name="resolver"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.Approval" maxOccurs="unbounded" name="approvals"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.ApprovalDescriptor" maxOccurs="unbounded" name="approvalDescriptors"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.process.Iteration" maxOccurs="1" name="target"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.Deliverable" maxOccurs="1" name="foundIn"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.repository.BigDecimalExtensionEntry" maxOccurs="unbounded" name="bigDecimalExtensions"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.repository.LargeStringExtensionEntry" maxOccurs="unbounded" name="largeStringExtensions"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.repository.MediumStringExtensionEntry" maxOccurs="unbounded" name="mediumStringExtensions"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.repository.TimestampExtensionEntry" maxOccurs="unbounded" name="timestampExtensions"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.repository.StringExtensionEntry" maxOccurs="unbounded" name="stringExtensions"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.repository.LongExtensionEntry" maxOccurs="unbounded" name="longExtensions"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.repository.BooleanExtensionEntry" maxOccurs="unbounded" name="booleanExtensions"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.repository.IntExtensionEntry" maxOccurs="unbounded" name="intExtensions"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.WorkItem" maxOccurs="unbounded" name="itemHistory"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.process.TeamArea" maxOccurs="1" name="teamArea"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.State" maxOccurs="1" name="state"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.Resolution" maxOccurs="1" name="resolution"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.WorkItemType" maxOccurs="1" name="type"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.Literal" maxOccurs="1" name="severity"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.Literal" maxOccurs="1" name="priority"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.WorkItem" maxOccurs="1" name="parent"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.WorkItem" maxOccurs="unbounded" name="children"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.WorkItem" maxOccurs="unbounded" name="blocks"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.WorkItem" maxOccurs="unbounded" name="dependsOn"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.WorkItem" maxOccurs="unbounded" name="duplicatedBy"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.WorkItem" maxOccurs="unbounded" name="duplicateOf"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.WorkItem" maxOccurs="unbounded" name="related"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.ExtensionEntry" maxOccurs="unbounded" name="allExtensions"></xs:element>
<xs:element minOccurs="0" type="com.ibm.team.workitem.TimeSheetEntry" maxOccurs="unbounded" name="timeSheetEntries"></xs:element>
</xs:sequence>
<xs:attribute type="xs:anyURI" name="href"/>
</xs:complexType>
Display of the AuditableLink section
<xs:complexType name="com.ibm.team.links.AuditableLink">
<xs:sequence>
<xs:element type="xs:string" name="uniqueId"></xs:element>
<xs:element type="xs:string" name="stateId"></xs:element>
<xs:element type="xs:string" name="itemId"></xs:element>
<xs:element type="xs:string" name="contextId"></xs:element>
<xs:element type="xs:time" name="modified"></xs:element>
<xs:element type="xs:string" name="name"></xs:element>
<xs:element minOccurs="1" type="com.ibm.team.repository.Contributor" maxOccurs="1" name="modifiedBy"></xs:element>
<xs:element minOccurs="1" type="com.ibm.team.links.Reference" maxOccurs="1" name="sourceRef"></xs:element>
<xs:element minOccurs="1" type="com.ibm.team.links.Reference" maxOccurs="1" name="targetRef"></xs:element>
</xs:sequence>
<xs:attribute type="xs:anyURI" name="href"/>
</xs:complexType>