We appreciate you taking the time to vote and add your suggestions to make our products awesome! Your request will be submitted to the community for review and inclusion into the backlog.

We recommend reviewing what is submitted before posting, in case your idea has already been submitted by another community member. If it has been submitted, vote for that existing feature request (by clicking the up arrow) to increase its opportunity of being added to Cireson solutions.

For more information around feature requests in the Cireson Community click here.

Keep Tasks pane available for closed work items

Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
This a feature request, but a workaround would be very welcome too.  When a CR is closed, the Tasks pane is completely absent from the form, which presents some problems for us.  It still serves a purpose!

To illustrate the point, we have a mix of OOB and custom tasks that would still be useful with closed CRs:
  • Print (Ever needed to produce a change record for an audit response, anyone?)
  • Time zone conversion table (displays all date/time fields in other time zones where we have offices--I would love to re-write this as an inline feature within the form itself, but this was easier to implement)
  • Activity history--thanks for the code!
  • Copy this change (not having this is causing our users the most grief!)
  • Paging (lets users move from tab to tab without scrolling back to the top)
Related Articles also attaches to the Tasks pane, and is therefore unavailable when it is not present.  It is common to review old tickets for infrequent (e.g. yearly) changes, and the KB is just as relevant in that case.
19 votes

Submitted · Last Updated

Comments

  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    While I still think this is best handled as a feature request (did I mess up the post?  no voting buttons...) and included in a future portal version, I did figure out how to accomplish this through customization.  This is a simplified version with some example tasks that will not work for you, but you can see how it is done:

    // in custom.js

    As mentioned in the comments, ajaxStop is not an ideal method to use, but it is the only one that appears to occur at the right time, after some testing.  Although it is meant to occur after all ajax calls have finished, it actually fires multiple times, which is not all that surprising.  Therefore, you want to check if your task menu already exists.
    $(document).ready() and $(document).load() both occur too soon (objects do not exist yet), and overloading elements at ready, bind, etc. seems not to work at all, as though those events are being blocked somehow.

    On a CR (or other work item) that is not closed, the list items do not use an onClick event, but instead appear to be bound to functions that are stored within a JS object.  Those custom task functions exist even in a closed work item, but I did not see a simple way to bind them at the right time.  Perhaps someone with greater expertise can improve upon this, but it is a start.

    I have to assume that Cireson hid the task panel for closed work items intentionally, but doing so noticeably hinders several of our processes.  We have been leaving all our CRs in "Completed" status and leaving the Auto Close functionality dormant up to now.  With this in place, we can utilize closed work items more effectively until they are ready to be groomed.

    I hope this helps someone else, until the feature is added!
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    Update, since I tripped over this again during a search: don't use $(document).ajaxStop() {}.  The mutation observer is a much better way of timing the code.  I can post an updated version if anyone is interested.
  • Adrian_PaechAdrian_Paech Customer Advanced IT Monkey ✭✭✭
    edited February 2017

    Cheers Tom, much appreciated.

    Personally, this seems like more of a bug then a feature request.

    I don't understand why the code shouldn't run on a closed work item?

    Cheers,

    Adrian

  • Adrian_PaechAdrian_Paech Customer Advanced IT Monkey ✭✭✭

    Any Chance this feature request can be renamed to: "Enable running of 'Custom.js' on Closed Work Items'?

  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    I do not have the ability to change it anymore.  I would be open to renaming it, but it is important to note that custom.js does run on closed work items.  The functions that start with app.custom.formTasks.add() do not run/work as expected, however.  So if your code runs from $(document).ready(func(){ CODE HERE }), it will indeed run for a closed ticket.

    Getting the timing right (i.e. so your code doesn't run before the form is drawn/bound) requires a mutation observer and some testing, though.  Also, calling the Cireson tasks has proved to be a challenge.  I had to walk away from this before I was able to solve it.

    At the end of the day, I think we both want the same thing--to be able to treat closed tickets similarly to In Progress ones, even if most of the fields are no longer able to be edited, because even closed tickets are still part of some of our processes.  I am flexible regarding how that is achieved by Cireson, and regarding what phrasing brings in the votes.  :)
  • Adrian_PaechAdrian_Paech Customer Advanced IT Monkey ✭✭✭
    Ahh I see what you mean..
    Maybe.. "Allow matched custom.js functionality for closed work items"?
    i might be able to get one of the guys to change it if we can agree on something?
    Cheers,
    Adrian
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    How about "Enable events and tasks for Closed Work Items"?
  • Vladimir_BudyakVladimir_Budyak Customer IT Monkey ✭
    Hello!
    Is there any new information?
  • Jonathan_BolesJonathan_Boles Customer Ninja IT Monkey ✭✭✭✭
    @Tom_Hendricks, would you mind sharing the latest version of the code? We're looking to add the Activity History tasks to our closed parent work items that will make it easy to audit details of work items directly within the portal.
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    Something like this:

    $(document).ready(function () {
    	if (pageForm.viewModel.Status.Name === "Closed") {
    		var mainPageNode = document.getElementById('main_wrapper');
     
    		// create an observer instance
    		var observer = new MutationObserver(function (mutations) {
    			//The page changed. See if our title exists. If it does, then proceed.
    			var titleElement = $(".page_title"); //The title always exists when the form is rendered.
    
    			//An element with class of page_title exists.
    			if (titleElement.length > 0) {
    				//We are done observing.  Do not keep running this!
    				observer.disconnect();

    if ($("ul.taskmenu").length < 1) { // Add the task panel back into the form $(".task-panel").append("<h2>Tasks</h2><ul class='taskmenu'></ul>"); // Add the desired task functions back to the list
    $(".taskmenu").append("<li class='link' onclick='func1();'>Task1</li>"); $(".taskmenu").append("<li class='link' onclick='func2();'>Task2</li>"); $(".taskmenu").append("<li class='link' onclick='func3();'>Task3</li>"); $(".taskmenu").append("<li class='link' onclick='func4();'>Task4</li>"); }
    }
    });

    // configure the observer and start the instance. var observerConfig = { attributes: true, childList: true, subtree: true, characterData: true }; observer.observe(mainPageNode, observerConfig);
    }
    else {
    // The ticket isn't closed
    }
    });

    func1() { /* do stuff...*/ } func2() { /* do other stuff...*/ } func3() { alert('Hello, world!'); /*because why not?*/ } func4() { activateAllTheDevOpsThings(); /* because we can...*/ }

    The one thing I have not quite figured out how to do yet is to add out-of-box tasks from Cireson to the list.
  • Vladimir_BudyakVladimir_Budyak Customer IT Monkey ✭
    Guys, how to perform a standard Cireson function such as "sendmail" or "converttoParent" or " changeStatus" ?
  • Vladimir_BudyakVladimir_Budyak Customer IT Monkey ✭
    Oops, I only now saw the answer here!
    Thanks!
Sign In or Register to comment.