`I have done automation of backing up azure board work item in csv form to my local using API now I'm trying to restore it back into the azure boards. I'm not getting the proper approach to do that, can any one help me in this
POST https://dev.azure.com/fabrikam/{project}/_apis/wit/workitems/${type}?api-version=7.1-preview.3
[
{
"op": "add",
"path": "/fields/System.Title",
"from": null,
"value": "Sample task"
}
]
You need to get the data from csv file, and update the work item with rest api Work Items - Update.
Here is a doc which mention with c# sample, if you would like to use powershell script, please check below.
Typically the csv file could have below columns(if it's different, please modify the script accordingly).
Please note:
Area Path, it could contain\in the path, which need be changed to\\, otherwise udpate will fail.Powershell script:
My original work item:
Work item updated.
Edit: to restore the work items to a new project, you need:
Change to use rest api Work Items - Create.
Remove areapath as it's differnet between different projects. If there's other field conflict, please remove as well.
Code below:
Work items created.