Stop addInfoMessage Displaying twice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2016 09:04 AM
Hello,
I am using a BR script in Test Management module to update test case Execution status based on Child test status. But the addInfoMessage displays twice. How to stop it
Tried this script running in Before and After scripts couldn't fix it:
Running the script in-- test case[tm_test_case_instance] table
var sysid = current.sys_id;
var ctest = new GlideRecord("tm_test_instance"); // test table
ctest.addEncodedQuery('execution_status!=passed^tm_test_case_instance='+sysid);
ctest.query();
if (ctest.getRowCount()==0)
{
gs.addInfoMessage("passed");
}
How to fix this, anything wrong with the script?
Thanks,
Alad.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2016 10:40 PM
I don't know why this happening, if any fix for this will be good.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2016 10:51 PM
Hi Anto,
Turn on Debug Business Rules Details... you should see when every BR runs on an object and in what order. It could help you spot whether your BR is running twice, and maybe what's leading to it.
Thanks,
-Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2016 04:47 AM
Hi Anto,
Brian's idea is the best way to go in my opinion. Debugging BR saved me tons of time and frustration. Checking code by eye is fine but you might have some odd case triggered in the run time that is causing the issue.
Cheers
Greg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2016 05:18 AM
hi Grey,
Thanks, But i don't know debugging, i m post the debugging output here, Can you find whats going wrong behind.
Debugging output in tm_test_case_instance table by selecting business rule and others.
05:14:43.750: Execute before_display before business rules on tm_test_case_instance:TMTT0000019
05:14:43.750: Global ==> 'Build scratchpad for task' on tm_test_case_instance:TMTT0000019
05:14:43.756: Global <== 'Build scratchpad for task' on tm_test_case_instance:TMTT0000019
05:14:43.757: Global === Skipping 'Calc SLAs on Display' on tm_test_case_instance:TMTT0000019; condition not satisfied: Condition: gs.getProperty("glide.sla.calculate_on_display") == "true" && gs.getProperty("com.snc.sla.run_old_sla_engine") != "true" && !current.isNewRecord()
05:14:43.757: Finished executing before_display before business rules on tm_test_case_instance:TMTT0000019
05:14:43.801: Execute before query business rules on sys_user:
05:14:43.801: Global === Skipping 'user query' on sys_user:; condition not satisfied: Condition: gs.getSession().isInteractive() && !gs.hasRole("admin")
05:14:43.801: Finished executing before query business rules on sys_user:
05:14:44.70: >>> Preceding lines from previous transaction
05:14:44.86: Execute before_display before business rules on tm_test_case_instance:TMTT0000019
05:14:44.86: Global ==> 'Build scratchpad for task' on tm_test_case_instance:TMTT0000019
05:14:44.89: Global <== 'Build scratchpad for task' on tm_test_case_instance:TMTT0000019
05:14:44.90: Global === Skipping 'Calc SLAs on Display' on tm_test_case_instance:TMTT0000019; condition not satisfied: Condition: gs.getProperty("glide.sla.calculate_on_display") == "true" && gs.getProperty("com.snc.sla.run_old_sla_engine") != "true" && !current.isNewRecord()
05:14:44.90: Finished executing before_display before business rules on tm_test_case_instance:TMTT0000019
05:14:44.144: Execute before query business rules on sys_user:
05:14:44.144: Global === Skipping 'user query' on sys_user:; condition not satisfied: Condition: gs.getSession().isInteractive() && !gs.hasRole("admin")
05:14:44.144: Finished executing before query business rules on sys_user:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2016 10:37 AM
Hi Anto,
In that debugging output:
"==>" means it's launching that particular business rule
"<==" means it's returning from execution of that business rule
If there is a change of values, you will see it listed between these two markers.
Thanks,
-Brian