Skip to content

Automate A Template

This video gives a quick demonstration of rulesets.

By no means is this example exhaustive. There is MUCH more functionality available, but it shows the basic process of creating, linking and testing a ruleset.
Before diving in deeper we recommend that you read the documentation on ruleset development.

A different template is required for creating rulesets. Copy the following link and alter the URL for your specific environment:

Once you have created and saved your ruleset document, navigate to the 'Issue' template you created earlier and append the following to the template URL - /abb10be0-b9dc-11e7-8013-1f0b88022708


This provides the method to link the ruleset to the template. In the 'OnFieldChange (Client) related field, search for the name of your ruleset and save.

#include "JayRule Ruleset Overlay JS",

    ruleset : {
        name : 'myApplication - Issue - OnFieldChange',

        ruleSetDates : {
            ruleCondition : function(ntf) {
                var fieldChanged = ntf.context.fieldChanged;
                return (fieldChanged === 'status');

            ruleAction : function(ntf) {
                if(ntf.document.status === 'Started'){
                    ntf.document.startedDate = new Date();
                if(ntf.document.status === 'Completed'){
                    ntf.document.completedDate = new Date();