Configure JIGS Workflow Rules By Yourself
Please find the below steps to configure the JIGS workflow rules by yourself,
Step 1: Configure automation workflow rule
Log in to your Zoho CRM account using your credentials.
Click on the "Settings" icon (gear icon) in the upper-right corner.
Under "Setup," select "Automation."
In the Automation section, click on "Workflow Rules."
Click the "Create Rule" button to create a new workflow rule.
Give your rule a name and description for reference.
Choose the Zoho CRM module you want to apply the rule from the "Module" dropdown.
Choose when the rule should be evaluated.
Specify what actions should occur when the rule criteria are met. Here choose Function as an action.
If you already have an existing workflow rule and want to execute the JIGS function after your action, then you can ignore the above step instead you can call the below function Trigger JIGS For Lead Module as scheduled action. (shown on the right side) this way you can execute the JIGS function once your workflow is completed.
Step 2: Configure a new Function
Configure the Function, and choose the "Write your own" option.
Give the function name and display name as written below.
E.g. Function Name for Leads: triggerJIGSForLeadModule, similarly for other modules.
Display Name:
Trigger JIGS For Lead Module
By clicking on the Create button in the previous step you will be redirected to Deluge script editor.
Click on the Edit Arguments link first.
In the Argument mapping section add "id" and in the value type # as shown on the right side.
Choose the module Eg. Leads
In the Add Merge Field section Choose Lead Id as value.
Save the arguments.
Paste the following code,
moduleName = "Leads";
dataObj = zoho.crm.getRecordById(moduleName,id);
finalDataObj = jivrusintegraforgooglesheets.formatValueByDataType(dataObj);
jivrusintegraforgooglesheets.pushRecordToGoogleSheetUsingSettings(moduleName,finalDataObj,"CREATE");
Save the function and workflow rule.
You are now ready to trigger your own JIGS workflow rule. and please make sure you have disabled the existing workflow Eg. Create Lead & Edit Lead from the extension.
For the Edit workflow rule please change the "CREATE" to "EDIT" in the above code.
jivrusintegraforgooglesheets.pushRecordToGoogleSheetUsingSettings(moduleName,finalDataObj,"EDIT");