How do I change the state of a test case using the (rest or oslc) API?
We are using CLM 6.0 tools.
I started with the RQMUrlUtility, and am able to successfully create a test case and a test script.
In both cases I cannot import them in the desired state. They always want to be in the Draft state.
Because of the large number of test cases and test scripts, I want to modify the states via the program.
I can retrieve the test case's (or test script's) internal id. I can get the whole test case/script via the rest API using the internal id.
I cannot determine how to set the test case state (I also need to get the test case state to verify the tool did what I wanted).
Help!
Thanks
Thanks
2 answers
It should be no different from updating other attributes. But as you observed, you cannot set the state to any value because it has to conforms to workflow. For example, by default, the "draft" state is the starting state. To see the current configuration of workflows, go to Manage This Project Area and choose Workflows at the bottom left. Note that each test artifact type can have different workflow.
For your issue, you can do it in two ways.
1. Create the test artifacts as usual, and move the state to the desired one according to the workflow - you may need to do multiple PUT operations against a test artifact to achieve this.
2. Only when you are the only one actively using the RQM project:
a. Change the starting state to the desired one in a workflow of a test artifact type.
b. Save the change.
c. Create test artifacts of that particular state and particular type.
d. Repeat a. - c. for each state.
e. Change the starting state back to Draft.
f. Repeat a. - e. for each test artifact type.
For your issue, you can do it in two ways.
1. Create the test artifacts as usual, and move the state to the desired one according to the workflow - you may need to do multiple PUT operations against a test artifact to achieve this.
2. Only when you are the only one actively using the RQM project:
a. Change the starting state to the desired one in a workflow of a test artifact type.
b. Save the change.
c. Create test artifacts of that particular state and particular type.
d. Repeat a. - c. for each state.
e. Change the starting state back to Draft.
f. Repeat a. - e. for each test artifact type.