Business Rule Condition call Script Include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2021 10:58 AM
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
- Labels:
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2021 12:10 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2021 12:07 PM
Change the script include as below
var from_Idea = Class.create();
from_idea.prototype = {
initialize: function() {},
checkIdea: function(grStory) {
var gr = new GlideRecord("idea");
gr.addQuery("task", grStory.getUniqueValue());
gr.query();
if (gr.hasNext()) {
return true;
} else
return false;
},
type: 'from_Idea'
};
and keep the condition same as below
new from_Idea.checkIdea(current)
This will remove the error

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2021 12:13 PM
I have just realized 1 more question during creation of rm_story, we might not be having related record in idea with task as story. Is that correct? If so we need to identify another condition how to check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2021 12:22 PM
The task field on idea stores the reference to story after creation. Parent is Idea and Story is Child but the Child does not store reference to Parent thus query to parent passing child sys_id. Hope this helps. Thanks, Chad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2021 12:35 PM
As two more modifications are required,
We need to change the BR to after with a very high order 50000 as we are going to current. update
current.assignment_group = "sys_id of the group";
current.setWorkflow(false);
current.update();
As we know current.update() is not recommended hence we are using it with
setWorkflow