Pulling the status of a Test Case
Accepted answer
testcase/state (_value) will provide the state, which you can edit with a Script Expression as follows:
if(_value == "com.ibm.rqm.planning.common.new"){
'Draft';
}else if(_value == "com.ibm.rqm.planning.common.underreview"){
'Under Review';
}else if(_value == "com.ibm.rqm.planning.common.approved"){
'Approved';
}else if(_value == "com.ibm.rqm.planning.common.retired"){
'Retired';
}else {
_value;
}
I presume you are using testcase feed URL (https://server:port/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<ProjectArea>/testcase?abbreviate=false), which does not return status. You should use the URL of the individual test case that the Atom feed publishes (https://server:port/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<ProjectArea>/testcase/urn:com.ibm.rqm:testcase:<id>). In RPE template, you should (also) have qm schema added.
If you want to print execution result/status (Failed, Passed, Inconclusive, etc.), you should use executionresult/state/_value.
var mystate = _value;
mystate = mystate.replace("com.ibm.rqm.execution.common.state.","");
mystate = mystate.substr(0, 1).toUpperCase() + mystate.substr(1);
mystate;
Please let us know if you need a sample template.
if(_value == "com.ibm.rqm.planning.common.new"){
'Draft';
}else if(_value == "com.ibm.rqm.planning.common.underreview"){
'Under Review';
}else if(_value == "com.ibm.rqm.planning.common.approved"){
'Approved';
}else if(_value == "com.ibm.rqm.planning.common.retired"){
'Retired';
}else {
_value;
}
I presume you are using testcase feed URL (https://server:port/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<ProjectArea>/testcase?abbreviate=false), which does not return status. You should use the URL of the individual test case that the Atom feed publishes (https://server:port/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<ProjectArea>/testcase/urn:com.ibm.rqm:testcase:<id>). In RPE template, you should (also) have qm schema added.
If you want to print execution result/status (Failed, Passed, Inconclusive, etc.), you should use executionresult/state/_value.
var mystate = _value;
mystate = mystate.replace("com.ibm.rqm.execution.common.state.","");
mystate = mystate.substr(0, 1).toUpperCase() + mystate.substr(1);
mystate;
Please let us know if you need a sample template.