History tab - Auto expand
Best Answers
-
Geoff_Ross Cireson Consultant O.G.Hey Eugene,
Here's some js code. It binds to the History Tab link and calls the function to load the history when clicked. It will do this across all work item types.
Enjoy.
UPDATE New Add-In just released for this:https://kb.cireson.com/article/user-guide-add-in-auto-show-history/2615
Geoff
7 -
Leigh_Kilday Member Ninja IT Monkey ✭✭✭✭I assume this is because the fields on each tab are loaded when the page loads, not just when you click the tab link. You may notice that retrieving the history by clicking the button isn't immediate, so adding this load time to every page load may not be desirable.5
-
Geoff_Ross Cireson Consultant O.G.Everything is loaded on page load except the history. This is because this can be quite a lot of data. When you click the Show History button a separate API call is made to grab the history and display it. The solution above, still doesn't pull history on page load, but will as soon as the History Tab is accessed. The only downside is if History Tab is clicked in error, it will load the History but I see Eugene's point; people click History, to see history. I can't imagine many people click in error for this to give too much of a problem.7
-
Geoff_Ross Cireson Consultant O.G.Hi Eugene, that is correct.
I've also just updated this solution to also hide the Button as now its no longer needed.
Here's an example for IRs, replicate this across the rest if needed.app.custom.formTasks.add('Incident', null, function (formObj, viewModel) {
//bind a function to the form ready event
formObj.boundReady(function () {
$('a[data-cid=History]').on("click", function () {
pageForm.viewModel.view.loadHistory();
$('#historyView').prev('div').hide() // <----- here's the extra line
});
});
});
Geoff6
Answers
Here's some js code. It binds to the History Tab link and calls the function to load the history when clicked. It will do this across all work item types.
Enjoy.
UPDATE New Add-In just released for this:
https://kb.cireson.com/article/user-guide-add-in-auto-show-history/2615
Geoff
Hello Geoff
Thanx for the explanation regarding the History Tab. I understand that having history load for every IR/SR when you open it can be quite resource intensive on the database etc. Regarding your .js code above. It sounds like the history is not loaded when just viewing an IR /SR, but will only load when clicking the History tab, is that correct?
I've also just updated this solution to also hide the Button as now its no longer needed.
Here's an example for IRs, replicate this across the rest if needed.
Geoff
New Add-In just released for this:
https://kb.cireson.com/article/user-guide-add-in-auto-show-history/2615
Geoff