0

For my project we use the Test Plans and Test Cases work items within Azure DevOps for quite some time. Now from an automation perspective we want to rename a few of the paramters in some of our shared steps (which are used in >1000 testcases).

Is there a way we can do this automatically, as normally when you rename a parameter in Azure DevOps the parameter is removed from all testcases (including the data). We probably need to do something with the API's of Azure DevOps, but no clue where to start. So any idea is welcome.

Thanks in advance

2 Answers 2

1

I could reproduce the issue when I changed the parameter name from the shared steps set and the parameter was no longer referenced in the steps of the test case. enter image description here

For this, would you consider converting the parameter values to a shared parameter set? enter image description here

When we changed the referenced parameter name in the shared steps set, it will still prompt with the warning saying All the references to the following parameters and their values will be removed. While having saved the edits, we can then select the expected column header in the shared parameter set to map with the updated parameter name and the values under the new parameter name will be populated. enter image description here

Still, I am unable to find out an automated method to modify the shared steps and parameters of test cases with the help of REST APIs.

Hope the information can help.

Sign up to request clarification or add additional context in comments.

2 Comments

I like the idea, still hope to see an automated way but this indeed might help at first
Thx for the test and yes, I agree this is only a workaround to keep the parameters data. I don't see APIs support the automated workflow to convert to parameter set, update parameter name in steps and map parameter set with new parameter name. You may consider raising a feature request for individual API. Besides, would you accept the workaround for now, which may help others with similar concerns. Thx.
0

Another solution I have is to use the revisions of a testcase.

When you save the shared step (after renaming parameters) a new revision is added to the testcase*. Via the API you can retrieve the revision information, get the field where the data is stored (Microsoft.VSTS.TCM.LocalDataSource) and perform a replace of the changed parameters. This new data can then be uploaded via the API again.

*Each shared step save introduces new revisions, so when you want to change multiple in one go it is advised to only save once for easy scripting.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.