The CreatorCon Call for Content is officially open! Get started here.

How can we track update of description field?

Ajeet Kumar2
Tera Contributor

Clients are creating stories using Story form. I want a counter field which should increase by 1 whenever descriptions field gets updated to track the requirement change.

Currently when it is updated then both old and new descriptions are shown in Activity, however I want both old and new description's values should appear in green and blue color for better visibility.

 

How can we achieve the above requirement. 

Thank you,

1 ACCEPTED SOLUTION

SimonL898794821
Mega Sage

This idea doesn't seem very promising; it could potentially create confusion and messiness on the form. Perhaps you should think about saving older descriptions by adding an additional comment that clearly indicates they are previous descriptions.

View solution in original post

3 REPLIES 3

SimonL898794821
Mega Sage

This idea doesn't seem very promising; it could potentially create confusion and messiness on the form. Perhaps you should think about saving older descriptions by adding an additional comment that clearly indicates they are previous descriptions.

Ajeet Kumar2
Tera Contributor

I Agreed, but This does not happen so frequently but in some story it happens `by some user, so we want to track that therefore first I want create it in my PDI and then we will see how it looks and what changes we can implement in this. Considering this as requirement how can we achieve. Later on we can see what can be changed or added,

Thank you

I really do believe that this is bad practice but I created a before (insert/update) BR on the rm_story table with the following trigger condition: Description - changes. 

And a script like this:

(function executeRule(current, previous /*null when async*/ ) {
    // Get the old and new description values
    var oldDescription = previous.getValue('description');
    var newDescription = current.getValue('description');

    // Construct the updated description with old and new values
    var updatedDescription = newDescription + "\n\n" +
        '<span style="color: green;">Old Description:</span>\n' +
        '<span style="color: green;">' + oldDescription + '</span>';
    // Set the updated description field value
    current.setValue('description', updatedDescription);

})(current, previous);

 The HTML part (colors etc) won't work in the description field because it is not an HTML field. You can maybe accomplish this in the acceptance criteria field because that is HTML. 

 

Please mark this as helpful if it contributed to achieve your requirements.