SPEL code is a powerful tool to reach any goals but it still not documented. So most of it is written by trial and errors.
So here I want to share my resolution for most common action: Update one object caused by another.
Here is my latest version of function to make it (Entire function is added as attachment).
Usage example (with comments):
macro::upd_val("iss", // object factory format("id=%d",other_issue_id), // where clause to get object (or objects) 30, // delay to new retry if first iteration fails 3, // amount of retries "summary", // attribute to update "test 1", // new value "description", // another attr "test 2", // another value "z_etc_param", // amount of attributes that can be updated in 1 iteration is infinite "here is etc value"); // value can be string, integer or anything else.
Hope this helps to resolve common tasks and makes SPEL code easier to understand.
Any comments or suggestions are welcome!