This script will find the most recent "assigned" event in the case and create a link in the case to start editing the case with the assign-to set to the person who made that recent assignment.
name: Assign-Back case link
description: Adds a link in case view to assign the case back to the last assigner
author: Adam Wishneusky, Michel de Ruiter
version: 1.1.0.0
js:
var ignoreMe = true; // Set to false to assign back to yourself as well.
if (!$('#bugviewContainer').length)
return;
if (goBug.ixPersonAssignedTo != GetPersonID())
return;
var lastAssigner =
$('div.bugevents div.bugevent div.summary span.action:contains("ssigned to")' +
(ignoreMe ? ':not(:contains("by ' + $(username).text() + '"))' : '') +
':' +(fMostRecentEventFirst ? 'first' : 'last') + ' a.person + a.person');
if (!lastAssigner.length)
return;
window.AssignBack = function() {
$('#edit0').click();
$('select#ixPersonAssignedTo').val(lastAssigner.attr('data-ixperson')).change();
DropListControl.refresh($('select#ixPersonAssignedTo')[0]);
}
var linkSwipeHtml = '<a onclick="javascript:AssignBack()" href="#" title="to ' +
lastAssigner.text() + '">Assign Back</a>';
$('span.categoryAndAssignedTo').append(' ' + linkSwipeHtml);