Viewing a knowledge article updates the Last modified date in the article header to current date

eileenhessmille
Kilo Expert

Hi Community,

Just viewing a knowledge article from Service Desk > Knowledge updates the Last modified date field in the article header to current date. Where does that field get updated and how can it be fixed? We're on Fugi patch 10, but we kept Knowledge V2.

Thanks!

4 REPLIES 4

venkatiyer1
Giga Guru

Hi Eileen,



UI macro kb_article_header holds the information in the line


<span style="font-weight:bold;padding-left:8px;">${gs.getMessage("Last modified")}:</span>$[SP]$[jvar_updated_date]


Since this is an OOTB macro you might want to create a custom copy of it and leverage it.


Hi Venkat,


Thanks for the advice about copying the OOTB macro. I see that the macro is where the date is being displayed, but is that also where it is set? Under what conditions does it get updated?   The issue is that it's getting set to current day when the article is just viewed, not edited. Does the macro do that?



Thanks again.


Eileen


venkatiyer1
Giga Guru

Hi Eileen,





Yes it is getting set inside the macro itself. If you want dont want to display the last modified date there is a system property for it (glide.knowman.search.show_last_modified).



But to change its value, you would need to modify the macro.


If you notice in macro we have the updated date being caliberated within it


  <g2:evaluate var="jvar_updated_date">


  var dgo = kb.sys_updated_on.getGlideObject();


  var dt = new GlideDateTime(dgo);


  dt.getLocalDate().getDisplayValue();


  </g2:evaluate>


  <span style="font-weight:bold;padding-left:8px;">${gs.getMessage("Last modified")}:</span>$[SP]$[jvar_updated_date]


You can change this value accordingly.


The macro seems to be correct, I just don't want it to execute unless the article is actually changed. As it is, the 'last modified date' is set to current date when the article is viewed by a user. Not very useful.   In the end, I think I will just hide the field as you suggested.



Thanks again.



Eileen