The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Stop addInfoMessage Displaying twice

aladpereira
Mega Expert

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");

              }

addinfomessage error.jpg

How to fix this, anything wrong with the script?

Thanks,

Alad.

12 REPLIES 12

I don't know why this happening, if any fix for this will be good.


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


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


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:


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