How to access custom attributes of a particular work item from a particualr work area of RTC via API?
Accepted answer
You should be able to use this:
<...>/ccm/rpt/repository/workitem?fields=workitem/workItem[projectArea/name='Defect Management']/(id|summary|allExtensions[displayName='External Id']/(displayName|displayValue))
I have found that sometimes the Reportable REST API will permit searches on fields but will not always return data for them - it may be that you get an empty field where displayValue should be. You may need to fiddle
Comments
2 other answers
The OSLC API will give you back XML, JSON or ATOM feed data. To get JSON, add .json to your URL, and the 'Accept: application/json' header to your request. So for instance you can use this to get a list of Filed Against categories:
var xhrArgs = {
url : '/ccm/oslc/categories.json?oslc_cm.query=rtc_cm:projectArea="'
+ workItem.getValue(WorkItemAttributes.PROJECT_AREA)
+ '"%20and%20rtc_cm:archived=false',
headers : {
'Accept' : 'application/json'
},
handleAs : 'json'
};
jazzClient.xhrGet(xhrArgs).then(function(data) {
data['oslc_cm:results'].forEach(function(item) {
var cat = {
name : item['dc:title'],
data['oslc_cm:results'].forEach(function(item) {
var cat = {
name : item['dc:title'],
fullName: item['rtc_cm:hierarchicalName'],
id : item['rdf:resource'].split('/').pop(),
};
};
};
};
One last question Davyd & Ralph -
I've this REST API : https://xyx:8085/ccm/rpt/repository/workitem?fields=workitem/workItem[projectArea/name='Defect Management']/(id|summary|allExtensions[displayName='External ID']/(displayName|displayValue)) and it only returns limited number of recrods. However, I need all. What changes do I need to make to the mentioned url to get all the records.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 18 '19, 1:14 a.m.Amol Wangate
Jun 18 '19, 8:47 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 19 '19, 1:16 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 19 '19, 1:21 a.m.