Track Changes report in Spira

Wednesday, March 30, 2022
Avatar

One of the most often heard complaints after introducing Spira in our company, was people grumbling about how they were missing Word and how easy it was to see the changes in the requirements there (using the 'Track Changes'). Granted, Spira artifacts have a History view, but just to review the latest requirements additions, it's not very practical - especially if you have huge section of rich text...good luck finding the changes between now and last week! 

Many resorted to Word exports and using Word compare to a baseline they made before.

I thought there had to be a better solution, and fortunately there was. Spira has all the data needed to provide a smart 'track changes' report, with the last bit of 'smart behavior' provided by some Javascript included.

Initial experiments showed positive responses by users. The report is now set up as a HTML-only 'Last week's Requirements Changes', going a week back (but this can be easily changed in the SQL and XSLT). It includes a date selector that allows to filter out older changes (before a certain date).

The Javascript uses HTMLDiff (credits included in the XSLT), a handy bit of Javascript that performs the 'insertion' and 'deleted strike-through' formatting familiar from Word, although you might want to adapt your SpiraPlan html base template to style the <ins> and <del> tags to your specific tastes, as seen here: 

 

    ins {
    text-decoration: none;
    background-color: #d4fcbc;
    }

    del {
    text-decoration: line-through;
    background-color: #fbb6c2;
    color: #555;
    }

 

The XSLT is quite clumsy due to the fact that CDATA sections had to be included to the Javascript to be properly parsed, the fact that XSLT 1.0 does not have any Date/Time datatypes, and the fact that requirements also have requirements steps, which are technically different artifacts, but should be included where they are supposed to. However, it does the trick.

Mind you, multiple changes within the set time span of a single Field in a single Artifact are 'squashed', taking the difference between the oldest value and the newest value (which was more convenient than seeing multiple subsequent changes in the same field as different entries).

I used only standard fields, but you may want to adapt the requirement types in the SQL you that want to include in the report ...

Screenshots:

https://dennis-pie.tinytake.com/msc/NjY4MjkzNF8xOTI1OTE3Mw

https://dennis-pie.tinytake.com/msc/NjY4Mjk1MV8xOTI1OTE5MA

SQL and XSLT:

https://drive.google.com/file/d/1QcFzySmXfev_4ewYsPR66atD71-0DjPp/view?usp=sharing

Oh and Inflectra... I do think something like this should be included by default in your history view! Please add it to your backlog!

 

2 Replies
Thursday, March 31, 2022
Avatar
re: dl.pie Wednesday, March 30, 2022

Hi Dennis

We have this in our backlog and I've passed on your specific scripts to assist in the process!

Thanks again.

David

Friday, April 1, 2022
Avatar
re: inflectra.david Thursday, March 31, 2022

We need such history view too.

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Wednesday, March 30, 2022
  • Last Reply: Friday, April 1, 2022
  • Replies: 2
  • Views: 2195