Asset Updating Examples
This endpoint was introduced in 18.0, Winter 2018. Please view the About Digital.aiAgility information from the help icon in the menu bar to see if you are on this release or later.
Note: Examples will be given in preview mode by including "previewOnly=true
" query parameter. To commit the changes to Digital.ai Agility with these API examples, simply omit the "previewOnly=true
" query parameter. Edit section
Update single assets
curl -i -X POST \
-H "Content-Type:application/json" \
-H "Authorization:Bearer 1.BO9wxGpDbI2Oh2OPbhb7wW4ghj0=" \
-d \
'{
"from" : "Epic:4622",
"update" : {
"Description" : "I am the coolest Epic man!"
}
}' \
'https://yourVersionOneInstance/api/asset?previewOnly=true'
Update Multiple Assets
This updates the Description attribute of all Epics that are under some project called "Test Dump"
curl -i -X POST \
-H "Content-Type:application/json" \
-H "Authorization:Bearer 1.BO9wxGpDbI2Oh2OPbhb7wW4ghj0=" \
-d \
'{
"from" : "Epic",
"where" : {
"Scope.Name" : "Test Dump"
},
"update" : {
"Description" : "Queen of Epics!"
}
}' \
'https://yourVersionOneInstance/api/asset?previewOnly=true'
Find and Replace
This finds all defects that belong to a particular Epic. Once this is found, the Name attribute of the Defect is replaced.
curl -i -X POST \
-H "Content-Type:application/json" \
-H "Authorization:Bearer 1.BO9wxGpDbI2Oh2OPbhb7wW4ghj0=" \
-d \
'{"from": "Defect",
"where": {
"Super": "Epic:1161"
},
"update": {
"Name": {
"find": "Defect-1",
"replace": "Widget not responding to push."
}
}
}' \
'https://yourVersionOneInstance/api/asset?previewOnly=true'
Find and replace (Alternative)
Technically this is not a find and replace but effectively it is. This deletes a particular story from an epic and adds another one to replace it.
curl -i -X POST \
-H "Content-Type:application/json" \
-H "Authorization:Bearer 1.BO9wxGpDbI2Oh2OPbhb7wW4ghj0=" \
-d \
'{
"from" : "Epic",
"where" : {
"ID" : "Epic:1161"
},
"update" : {
"Subs" : {"Story:1781" : "remove",
"add" :[
{ "AssetType" : "Story",
"Name" : "Brand new story with attributes that I care about"}
]}
}
}' \
'https://yourVersionOneInstance/api/asset?previewOnly=true'