Hello Everyone,
We received a specific requirement from one of our customers and it has been fulfilled by utilising custom functions in Zoho Projects. Sharing the same here so that others with similar needs can benefit from it.
Requirement:
The user wanted to dissociate the Issue that is associated with the Task once the issue is resolved and closed. We have utilised the Issue custom functions in Zoho Projects to automate this.
A Custom function is a user-written set of code to achieve a specific requirement. We should create a connection with required scopes. Then, set up criteria for workflow rules and associate a custom function to that workflow / Business rule.
Custom function code:-
// update portalId and connection name
portalId = "ZOID";
connectionName = "xxxxxxxxxx";
getAssociatedTaskResponse = invokeurl
[
url :endPointV3 + portalId + "/projects/" + projectId + "/bugs/" + issueId + "/associated-tasks"
type :GET
connection:connectionName
];
for each associatedTask in getAssociatedTaskResponse.get("associated_tasks")
{
taskId = associatedTask.get("task").get("id");
dissociateAssociatedTaskResponse = invokeurl
[
url :endPointV3 + portalId + "/projects/" + projectId + "/bugs/" + issueId + "/task/" + taskId
type :DELETE
connection:connectionName
];
}
Make sure to replace "xxxxxxxxxx" in the above code with the connection link name and ZOID with your portal id.
Screenshots of the list of parameters to be mapped along with sample Business rules are attached for reference.
We hope you found this post useful. If you have any questions or wondering if your requirement could be met using custom functions, feel free to share them in the comments section below.