Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hello Community,
we are often asked why in the ALM Solution the item metrics are updated only once a day.
Actually, it is implemented that way, especially because such an update might take a long time and would affect the end users GUI performance negatively.
But, still companies are asking for a solution.
First of all, it is NOT suggested to change the field definition to perform the update dynamically. ´
What alternatives we offer?
Take a look at the attached trigger script. This script updates the Test Metrics on Test Objective level as soon as a Test Session is set to completed.
IMPORTANT: This trigger script is in experimental state. For sure you are welcome to try this out in your own TEST environment.
If you enable the parameter, it will also update the Test Objective parent, which should be another Test Objective or a Test Plan item.
Trigger: Recalc Test Metrics
Type: rule
Rule: ((field["Type"] = "Test Session") and (field'["State"] = "Completed") and (field["State"] != field'["State"]))
Scriptfile: recalcTestMetrics.js
Script timing: post
Any feedback is welcome!
Volker
// the Server log should print this. You can enable CUSTOM logging level to get the script details
[Server] CUSTOM(1): recalcTestMetrics.js: START: Running for Test Session ID 21722 in state Completed
[Server] GENERAL(10): Performing calculations to history for field Test Objective Fail Count
[Server] GENERAL(10): Calculating only issues [21720]
[Server] GENERAL(10): Performing calculations to history for field Total Fail Count
[Server] GENERAL(10): Calculating only issues [21720]
[Server] GENERAL(10): Performing calculations to history for field Test Objective Pass Count
[Server] GENERAL(10): Calculating only issues [21720]
[Server] GENERAL(10): Performing calculations to history for field Total Pass Count
[Server] GENERAL(10): Calculating only issues [21720]
[Server] GENERAL(10): Performing calculations to history for field Test Objective Other Count
[Server] GENERAL(10): Calculating only issues [21720]
[Server] GENERAL(10): Performing calculations to history for field Total Other Count
[Server] GENERAL(10): Calculating only issues [21720]
[Server] GENERAL(10): Performing calculations to history for field Test Objective Run Count
[Server] GENERAL(10): Calculating only issues [21720]
[Server] GENERAL(10): Performing calculations to history for field Total Run Count
[Server] GENERAL(10): Calculating only issues [21720]
[Server] CUSTOM(1): recalcTestMetrics.js: END.
Hello Volker,
First of all, thanks for looking into this. This is a common request in our company too.
I tried your script and it works.
However, it performs really slow. It took 23 seconds to update a handful of fields on one item. That's the same as it takes to update the general field history during the daily calculation. Given that comparison, I have the impression that the bean to update the field on a specific item still seems to calculate all items, even though the log states otherwise.
What's your experience with performance? Could my hunch be correct?
Thanks in advance for looking into it.
Adriaan
Hello Adrian,
I did several script installations and the calculation took less than 1 second only.
What I would need form you is the server log to check what was executed exactly.
Can you send me the server log with the details in it?
Thanks
Volker
Hello Volker,
Thanks a lot for this important information and appreciate your knowledge too.
I tried this and working perfectly and fruitful information for everyone.
Thanks Volker.
Regards,
Kapil