A custom function is a software code that can be used to automate a process and this allows you to automate a notification, call a webhook, or perform logic immediately after a workflow rule is triggered. This feature helps to automate complex tasks and calculations.
params = Map();params.put("sort_column","created_time");params.put("sort_order","descending");getAllProjects = invokeurl[url :projectsAPIEndPoint + "/portal/" + portalId + "/projects/"type :GETparameters:paramsconnection:"connectionprojects"];previousProjectPrefix = getAllProjects.get("projects").get(1).get("taskbug_prefix");if(previousProjectPrefix.contains(prefix)){if(previousProjectPrefix.length() == prefix.length()){newPrefix = prefix + "1";}if(previousProjectPrefix.length() > prefix.length()){iterator = previousProjectPrefix.subString(prefix.length()).toLong() + 1;newPrefix = prefix + iterator;}}else{newPrefix = prefix + "1";}params = Map();params.put("taskbugprefix",newPrefix);updateProject = invokeurl[url :projectsAPIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/"type :POSTparameters:paramsconnection:"connectionprojects"];return "success";