Automate your issues workflow using Custom Functions. A custom function is a piece of code that can be used for automating a process. You can write your own function in Deluge and call it from one or more business rules. It is similar to the built-in functions in Javascript like DATE, CONCAT, REPLACE, etc. In Zoho Projects, you can update the issue fields automatically using Workflow rules. With the help of custom functions, you can automate a notification, call a webhook, or perform logic right after a Workflow rule is triggered.
![Notes](https://static.zohocdn.com/zoho-desk-editor/static/images/file.png/)
Feature Availability: Latest Enterprise plan.
Benefits
- When an issue is escalated, user can be notified via an email or a Zoho Chat using custom functions.
- When an issue's severity is updated, a relevant comment can be added to the issue via a custom function.
- Integration can be done with Zoho Apps and third party apps using a custom function.
Add a Custom Function
- Click
in the top navigation bar.
- Navigate to Marketplace and click Custom Functions under Developer Space.
- Select Issues from the dropdown box.
- Click New Custom Function.
- Enter a Function Name and a Description.
- Set the Arguments.
- Type in your code in the Deluge script editor or drag and drop the parameters available in the left panel of the editor and customize them.
- Click Save.
![](https://help.zoho.com/galleryDocuments/edbsn6e1dd2212b114c235b32b6c9e357016daaef0f11d9d74c91ee463def5d22a6cde48e842282f61cb83e9bf89c318c73bd?inline=true)
![Idea](https://static.zohocdn.com/zoho-desk-editor/static/images/lights.png/)
Helen wants to notify a set of users in her project about the change of issue owner for a specific issue upon escalation. She might have to send the notification very often to the same set of users on this subject in the future as well. So, Helen decides to create a custom function and get it called through one of the business rules. This is how her custom function will look.
Associate a Custom Function With a Business Rule
- Click
in the top navigation bar. - Navigate to Issue Tracker and click Business Rules.
- Select a rule and navigate Actions tab.
- In Actions, click Call Custom Function.
- Click the plus icon
to create a new custom function or click the chain icon to call an existing function from the business rule. Click Save Rule.
Learn More about configuring business rules.
Gallery Functions
We have a few predefined gallery functions that are ready to use.
- Click
in the top navigation bar.
- Navigate to Developer Space and click Custom Functions.
- Hover over the drop-down beside the Custom Functions header and select Issues from the drop-down.
![](https://help.zoho.com/galleryDocuments/edbsn83209b2489aa693dca1be2483c131ffa9c71766d893367bb5593fced88f63155178790dd3571dfa1e45ae312469362c3?inline=true)
- Click Create Custom Function.
- Hover over any of the listed functions and click Use Function.
- In the Create Custom Function page, select the project, change the function name and arguments if needed.
Note: The deluge code is prefilled. The TODO lets users know the edits to the code before it can be executed.
![](https://help.zoho.com/galleryDocuments/edbsn4fb18e6aeee53272b0daa77796979508b51ffebea74f13a9a495cd5d066f6ca3ac2e521f7dfcf72595491ec61542aad8?inline=true)
- Click Save or Save and Execute to run the custom function.
Supported Gallery Functions
- Create a task for an issue
- Update the status of an associated task
- Create an issue and link it to an existing issue
- Sync bug status timeline with Analytics
- Send message to a Slack channel
- Approve or reject associated time log entries
- Auto-complete a phase
- Complete associated tasks once all issues are closed
- Update project status
- Update the status of a linked issue
- Sync bug due date changes with Analytics
- Count the number of times an issue is reopened
- Send message to a Cliq channel
Execute a Custom Function
- Click
in the top navigation bar. - Navigate to Marketplace and click Custom Functions under Developer Space.
- Select Issues from the dropdown box.
- Click the function that you would like to execute. Here, Helen tries to execute the function "Send_Mail".
- Click Save and Execute at the bottom.
- Enter the Issue ID (i.e, the argument).
- Click Execute.
Test Custom Function Integration
- Add test data in Zoho Projects that match your business rule criteria.
- Check for updates received from Zoho Projects in your application via a notification triggered through your custom function.
- If there is an error, modify your custom function in Zoho Projects and retest.
- Continue testing until you get the correct output. Here, John Marsh, Victor Young, and Lin Brenn receive a notification from Helen on the change in issue ownership.
You can add upto 10 arguments.