Custom Functions | Online Help | Zoho BugTracker

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 BugTracker, you can update the issue fields automatically using business rules. With the help of custom functions, you can automate a notification, call a webhook, or perform logic right after a business rule is triggered.

Benefits 

  • When a bug is escalated, user can be notified via an email or a Zoho Chat using custom functions.
  • When a bug's severity is updated, a relevant comment can be added to the bug via a custom function.
  • Integration can be done with Zoho Apps and third party apps using a custom function.

Add a Custom Function

  1. Click  in the top navigation bar.
  2. Navigate to Developer Space and click Custom Functions.
  3. Click Create Custom Function.
  4. Create your own custom function or select a gallery function based on your requirement. 
  5. If you're creating your own custom function, enter a Function Name and a Description.
  6. Set the Arguments.
  7. 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.
  8. Click Save.

We have a few predefined gallery functions that are ready to use.
  1. Click  in the top navigation bar.
  2. Navigate to Developer Space and click Custom Functions.
  3. Hover over the drop-down beside the Custom Functions header and select Issues from the drop-down.

  4. Click Create Custom Function.
  5. Hover over any of the listed functions and click Use Function.
  6. 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.

  7. Click Save or Save and Execute to run the custom function.
  1. Create a task for an issue
  2. Update the status of an associated task
  3. Create an issue and link it to an existing issue
  4. Sync bug status timeline with Analytics
  5. Send message to a Slack channel
  6. Approve or reject associated time log entries
  7. Auto-complete a phase
  8. Complete associated tasks once all issues are closed
  9. Update project status
  10. Update the status of a linked issue
  11. Sync bug due date changes with Analytics
  12. Count the number of times an issue is reopened 
  13. Send message to a Cliq channel  

 Associate a Custom Function With a Business Rule

  1. Click  in the top navigation bar.
  2. Navigate to Bug Tracker and click Business Rules.
  3. Select a rule and navigate to the Actions tab.
  4. In Actions, click Call Custom Function.
  5. Click the plus icon  to create a new custom function or click the chain icon  to call an existing function from the business rule.
  6. Click Save Rule.

Use case

The manager wants to notify a set of users in the project about the change of bug owner for a specific bug upon escalation. The manager might have to send the notification very often to the same set of users on this subject in the future as well. The manager creates a custom function and get it called through one of the business rules.

Execute a Custom Function

  1. Click  in the top navigation bar.
  2. Navigate to Developer Space and click Custom Functions.
  3. Click the function that you would like to execute. Here, Helen tries to execute the function "Send_Mail".
  4. Click Save and Execute at the bottom.
  5. Enter the Issue ID (i.e, the argument).
  6. Click Execute.

Test Custom Function Integration

  1. Add test data in Zoho BugTracker that match your business rule criteria.
  2. Check for updates received from Zoho BugTracker in your application via a notification triggered through your custom function.
  3. If there is an error, modify your custom function in Zoho BugTracker and retest.
  4. Continue testing until you get the correct output.

More Reads