Hello Bethanne Mcfadden,
Thank you for your question. Importing tasks from a CSV file and automatically linking them to an existing user story is a powerful feature in Azure DevOps for managing your backlog efficiently.
The process involves creating a specifically formatted CSV file where you identify the existing user story and then list the new tasks directly beneath it. Azure DevOps interprets this structure as a parent-child relationship during the import process.
Here is a step-by-step guide to achieve this.
Step 1: Get the ID of the Existing User Story
First, you need the unique ID of the user story you want to link the new tasks to. You can find this ID by simply opening the user story in Azure DevOps Boards. Note this ID number down.
Step 2: Prepare Your CSV File
This is the most critical step. Your CSV file must be structured in a specific way to create the parent-child link.
The first row in your group will represent the existing parent User Story. You only need to provide its ID and Work Item Type.
The subsequent rows will be for the new Tasks you are importing. You do not need to provide an ID for these, as Azure DevOps will assign new ones. You only need to provide the Work Item Type and a Title for each new task.
Create a CSV file with the following columns and structure. Let's assume your existing User Story has an ID of 12345.
| ID | Work Item Type | Title |
|---|---|---|
| 12345 | User Story | |
| 12345 | User Story | |
| Task | Design the database schema | |
| Task | Create the API endpoints | |
| Task | Develop the user interface |
Important Notes on the CSV Structure:
- Parent First: The parent work item (User Story) must be the first item in the group.
Child Items Follow: The new child work items (Tasks) must immediately follow the parent.
Title Column: The Title for the parent User Story row can be left blank because you are only referencing it by its ID. You only need to provide titles for the new tasks you are creating.
Other Columns: You can add other columns as needed for your tasks, such as Assigned To, Area Path, Iteration Path, Description, and Activity (e.g., Development, Testing).
Example of a more detailed CSV:
| ID | Work Item Type | Title | Assigned To | Activity |
|---|---|---|---|---|
| 12345 | User Story | |||
| 12345 | User Story | |||
| Task | Design the database schema | ******@company.com | Design | |
| Task | Create the API endpoints | ******@company.com | Development | |
| Task | Develop the user interface | ******@company.com | Development |
Step 3: Import the CSV File into Azure DevOps
Once your CSV file is ready, you can import it through the Queries section of Azure DevOps.
Navigate to your project in Azure DevOps.
In the left-hand menu, go to Boards > Queries.
Click on the "Import Work Items" button, which is usually located near the top of the page.
In the dialog box that appears, click "Choose file" and select the CSV file you created.
Click Import.
Azure DevOps will show you a preview of the work items that will be created. You will see your new tasks listed.
Click the "Save items" button to complete the import.
Azure DevOps will now create the new tasks and automatically link them as children to the existing user story (ID 12345). You can verify this by opening the user story and checking the "Related Work" section.
This method allows you to quickly populate your backlog with a structured set of tasks for any existing user story.
Best Regards,
Jerald Felix