cancel
Showing results for 
Search instead for 
Did you mean: 

Updating Task Variables in bulk through REST API?

jordan_blair
Champ in-the-making
Champ in-the-making
Through the REST API I can create task variables in bulk, but it appears updating task variables in bulk is not supported using a put/patch to /runtime/tasks/{id}/variables.  If you wanted to update variables you have to do it for a single variable instance.  I just wanted to confirm that there is not a "undocumented" capability to perform task variable updates in bulk.

We have thought about the option of using the delete all Task Variables… and then posting them all back… which reduces increases our overall performance because we are only making to calls to the REST API.  That works, but does have a few negative consequences in my mind such as creating a (small) window where a user task search could return zero results because it happened within the time of the delete all/create transaction…

Does anyone else have any ideas on how we could avoid iterating over the variables for a single task an performing singular task variable update operations… 

Thanks in advance,
Jordan
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
No, the PUT seems to only take one variable at the time.

However, looking at the code … a POST again with the updated variables might actually do an update behind the scenes!
Could you try that (havent verified it - so sorry if it's not working)

jordan_blair
Champ in-the-making
Champ in-the-making
Thanks for the response.  I feel like i did try to do a PUT… but it didn't work..  I will try again to make sure.

anjan
Champ in-the-making
Champ in-the-making
Hi Jordan, were you able to update the task variables in bulk.  If so, could you please let me know the REST call to make.