Skip to main content
System StatusContact Support
VersionOne Community

Asset Updating Examples

This endpoint was introduced in 18.0, Winter 2018. Please view the About VersionOne information from the orange help icon in the menu bar to see if you are on this release or later.

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'

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'

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'

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'
  • Was this article helpful?