How to programmatically get list of all filed against values?
I am using perl to programmatically get a list of Filed Against values.
$url/ccm/oslc/context/$UID/shapes/workitems/com.ibm.team.apt.workItemType.story/property/category/allowedValues
results in
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#">
<oslc:AllowedValues rdf:about="$url/ccm/oslc/context/_Z2CigCMREeSu9IVVns_JHg/shapes/workitems/com.ibm.team.apt.workItemType.story/property/category/allowedValues">
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bW4qMCMREeSu9IVVns_JHg"/>
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_aG6QECMREeSu9IVVns_JHg"/>
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bV_5YCMREeSu9IVVns_JHg"/>
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bW9isCMREeSu9IVVns_JHg"/>
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bXIh0CMREeSu9IVVns_JHg"/>
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bXDCQCMREeSu9IVVns_JHg"/>
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bWkhICMREeSu9IVVns_JHg"/>
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bV2IYCMREeSu9IVVns_JHg"/>
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bWRmMCMREeSu9IVVns_JHg"/>
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bXbcwCMREeSu9IVVns_JHg"/>
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bXgVQCMREeSu9IVVns_JHg"/>
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bXlNwCMREeSu9IVVns_JHg"/>
<oslc:allowedValue rdf:resource="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bWuSICMREeSu9IVVns_JHg"/>
</oslc:AllowedValues>
</rdf:RDF>
I then iterate through each <oslc:allowedValue rdf:resource to request the title of each category:
i.e.
$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bW4qMCMREeSu9IVVns_JHg
returns
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
xmlns:dcterms="http://purl.org/dc/terms/">
<rtc_cm:Category rdf:about="$url/ccm/resource/itemOid/com.ibm.team.workitem.Category/_bW4qMCMREeSu9IVVns_JHg">
<rtc_cm:depth rdf:datatype="
1
0 votes
Accepted answer
https://clm:9443/ccm/rpt/repository/workitem?fields=workitem/category/*You may need to fine tune the output using field filtering and selection.
https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#Field_selection_and_filtering
Comments
The reportable REST API and filtering is giving me better results:
https://ccm/rpt/repository/workitem?fields=workitem/category[contextId='$contextID' and archived='false']/(contextId|itemId|name|qualifiedName|archived)
The only potential issue I can see is that the values returned are for all workitem types. If a task and story have different values, I am not sure how to obtain these using the Reportable Rest API.
1 vote
You change your mind so it becomes an issue. :-)
If you want to get the categories "being used" (as opposed to "available"), you need to query from the existing work items. Something like this.
https://clm/ccm/rpt/repository/workitem?fields=workItem/workItem[type/id="task"]/category/*
One other answer
Is it possible to get the enum attributes in workitem say list of "priorities" or "severity"
Comments
Please read How should I ask a question in the Forum if I want to receive useful answers? and create your own question instead of answering with a question at a totally unrelated question (that is already answered and correctly three years ago). Thank you.