how to get DuplicateOf/Duplicates WI ids
One answer
$prodDefectquery = $ref->{'oslc_cm:changeRequests'}{'oslc_cm:simpleQuery'}{'oslc_cm:url'};
$cmd = "curl -s -k -b $cookies -o ./prod_defectquery.$$ -H \"accept: application/x-oslc-cm-change-request+xml\"
\"${prodDefectquery}?oslc_cm.query=id=${wi}&oslc_cm.properties=rtc_cm:com.ibm.team.workitem.linktype.duplicateworkitem.duplicateOf,rtc_cm:com.ibm.team.workitem.linktype.duplicatework
item.duplicates\"";
In the output file, you will see something like:
rtc_cm:com.ibm.team.workitem.linktype.duplicateworkitem.duplicateOf oslc_cm:collref="URI/oslc/workitems/_GK5iQFNWEeG-2-7002zNIA/rtc_cm:com.ibm.team.workitem.linktype.duplicateworkitem.duplicateOf"
rtc_cm:com.ibm.team.workitem.linktype.duplicateworkitem.duplicates oslc_cm:collref="URI/oslc/workitems/_GK5iQFNWEeG-2-7002zNIA/rtc_cm:com.ibm.team.workitem.linktype.duplicateworkitem.duplicates"
You can then extract the URI link and run another curl command on that URI to get the information about the duplicates.
$cmd = "curl -s -k -b $cookies -o ./prod_defectquery.$$ -H \"accept: application/x-oslc-cm-change-request+xml\"
\"${prodDefectquery}?oslc_cm.query=id=${wi}&oslc_cm.properties=rtc_cm:com.ibm.team.workitem.linktype.duplicateworkitem.duplicateOf,rtc_cm:com.ibm.team.workitem.linktype.duplicatework
item.duplicates\"";
In the output file, you will see something like:
rtc_cm:com.ibm.team.workitem.linktype.duplicateworkitem.duplicateOf oslc_cm:collref="URI/oslc/workitems/_GK5iQFNWEeG-2-7002zNIA/rtc_cm:com.ibm.team.workitem.linktype.duplicateworkitem.duplicateOf"
rtc_cm:com.ibm.team.workitem.linktype.duplicateworkitem.duplicates oslc_cm:collref="URI/oslc/workitems/_GK5iQFNWEeG-2-7002zNIA/rtc_cm:com.ibm.team.workitem.linktype.duplicateworkitem.duplicates"
You can then extract the URI link and run another curl command on that URI to get the information about the duplicates.
is there a way to get DuplicateOf/Duplicates WI ids using OSLC ?