There is a solution to avoid if-else code in vTiger. You can use special task that's called “Decision Table”.
This task contains of two columns — “Decision” and “Output” where user should put conditions into the first column and use the second one for writing the results.
Number one: this row provides environments or fields that you choose to validate incoming information and to write the result.
On this screenshot I use environment that i get from website (decision) and I also use static field (output) to write the information in it.
Others: this column (2) is for conditions. I check if environment $smownerid: (Users) branch_id) is equal 7889 and if it is then fieldvalue “Ответственный” will be filled with 47 (3). If this condition is false the task “Decision table” will use the condition below. You may add as many conditions as you need.