Disclaimer: The statements and opinions expressed in this article are those of the author(s) and do not necessarily reflect the positions of Thoughtworks.
In this blog post, I will explain another useful example of Twist's customized HTML reports. Usually test scenarios are associated with story cards. Twist simplifies this by allowing scenarios to be tagged to stories.

This can be done by adding story number tags to the scenario. For example, if a scenario is associated to card #10, you can tag “#10” on the Twist scenario (#10 is used by convention. You can use any thing for representing an issue/story card). You can now customize Twist HTML reports and when Twist encounters tags like “#10” they can be linked to the story card or issue page in your project management tool.
In this blog post, we will use Mingle, however this approach will work for any project management tool.
Mingle cards follow a URL format like, "http://mingle.yourdomain.com/projects/projectname/cards/10". We will modify the report template on a Twist project and add the following code to "index.html".
window.twist.onScenarioDisplayed = function(scenario) {
initLightbox();
linkTagsToMingleCard();
}"linkTagsToMingleCard()" will find the “tags” HTML element, loop through all the tags and link it if the tag starts with a '#' character.
function linkTagsToMingleCard() {
// Default report renderer puts tags in a div with id "tagsHolder" and each tag is in a li
$('#tagsHolder').find('li').each(function(index, value) {
var tag = $(value).text();
if (tag.length > 0 && tag[0] == '#') {
var a = document.createElement('a');
a.setAttribute('href', 'http://www.yourdomain.com/projects/projectname/cards/' + tag.replace('#', ''));
a.appendChild(document.createTextNode(tag));
$(value).empty();
$(value).append(a);
}
});
}In this way, you can customize HTML reports by adding relevant, additional information to them.
Disclaimer: The statements and opinions expressed in this article are those of the author(s) and do not necessarily reflect the positions of Thoughtworks.
Thoughtworks acknowledges the Traditional Owners of the land where we work and live, and their continued connection to Country. We pay our respects to Elders past and present. Aboriginal and Torres Strait Islander peoples were the world's first scientists, technologists, engineers and mathematicians. We celebrate the stories, culture and traditions of Aboriginal and Torres Strait Islander Elders of all communities who also work and live on this land.
As a company, we invite Thoughtworkers to be actively engaged in advancing reconciliation and strengthen their solidarity with the First Peoples of Australia. Since 2019, we have been working with Reconciliation Australia to formalize our commitment and take meaningful action to advance reconciliation. We invite you to review our Reconciliation Action Plan.