Business Rule Condition call Script Include

Chad Wilhelm1
Tera Expert

Hello,

We currently have this business rule which runs on story that sets Epic and Assignment Group.   We want to override this if the story is not created from an Idea.  So if a story is created manually do not set Epic and Assignment Group. So I thought call SI from BR Condition and return true if the task field on idea matches a story sys id.    Not sure what I am doing wrong here.  Any assistance is appreciated.  Thanks, Chad

find_real_file.png

find_real_file.pngfind_real_file.png

 

11 REPLIES 11

Hi ,

If I helped you to resolve your query with my answer. Then I would really appreciate if you can mark my answer correct and helpful. So that it can be moved to answered list and helpful for future readers.

Regards,
Ujjawal

Pradyumna Das
Tera Expert

Please try to create a function outside of the initialize and in BR call that function by using new <ClassName>.<FunctionName >

It will work. if not then let me know. 

 

Script include:

var from_idea = Class.create();
from_idea.prototype = {
    initialize: function() {},
    checkIdea: function(grStory) {
        var gr = new GlideRecord("idea");
        gr.addQuery("task", grStory.sys_id);
        gr.query();
        if (gr.hasNext()) {
            return true;
        }
          return false;

    },
    type: 'from_idea'
};

 

BR: new from_idea.checkIdea(current) 

If this helps you please mark it correct or helpful.