Loading test cases to a User Story in Rally using the API randomly drops test cases because of a concurrency error
search cancel

Loading test cases to a User Story in Rally using the API randomly drops test cases because of a concurrency error

book

Article ID: 374600

calendar_today

Updated On:

Products

Rally SaaS

Issue/Introduction

Loading test cases to a User Story in Rally using the API randomly drops test cases 

Cause

This was caused by the script attaching the test cases one at a time. This caused concurrency issues when the post before hadn't finished before the next post began.

Resolution

  • Importing test cases using the collections endpoint resolved this issue 
    • This adds all the test cases to a User Story in one post which removes any concurrency issues from the import. 
    • Here is our help page on this with much more detail:  https://rally1.rallydev.com/slm/doc/webservice/rest_collections.jsp
    • The below is from postman and created a post with the following:

https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement/<UserStoryObjectID>/testcases/add?fetch=Name

Body:

{
    "CollectionItems": [
        {
            "Name": "New Test Case 4"
        },
        {
            "Name": "New Test Case 5"
        },
              {
            "Name": "New Test Case 6"
        },
        {
            "Name": "New Test Case 7"
        },
              {
            "Name": "New Test Case 8"
        },
        {
            "Name": "New Test Case 9"
        },
              {
            "Name": "New Test Case 10"
        },
        {
            "Name": "New Test Case 11"
        }
    ]
}