CA Service Management

 View Only
  • 1.  Is it possible to hide reopen status from drop down in request order detail page if request order is older more than 60 days in CA Service Desk 12.9?

    Posted Oct 05, 2017 02:40 AM

    Hi ,

    Is it possible to hide reopen status from drop down in request order detail page if request order is older more than 60 days in CA Service Desk 12.9?



  • 2.  Re: Is it possible to hide reopen status from drop down in request order detail page if request order is older more than 60 days in CA Service Desk 12.9?

    Posted Oct 05, 2017 08:56 AM

    Hi Central Bank India,

    Its not possible to directly do that without custom spelcode which would need to calculate the age of the ticket and then act based upon that. Unfortunately that is not something that we can assist with as its outside the scope of support - however, there may be folks that have done something similar and may be willing to share their info with you here on the community.  The challenge here is that we dont have an attribute to represent or calculate the age of a ticket.  We do have things that can calculate the time that the ticket was in a certain status (example being SLAs that are based on priority and status), or delay times on an event that can be calculated, but nothing to directly calculate the entire age of a ticket.  

    Anyone else have any ideas here for these folks?

    Jon I.



  • 3.  Re: Is it possible to hide reopen status from drop down in request order detail page if request order is older more than 60 days in CA Service Desk 12.9?

    Broadcom Employee
    Posted Oct 05, 2017 08:57 AM

    Hello,

     

    Firstly, we need to advise that your release of SDM (12.9) will soon be out of support and we recommend that you consider migration to one of our later releases of SDM (14.1 and 17 are currently available)

     

    On examination of the question itself, one thought to consider may be to use the auto-close function, where a user marks a ticket as Resolved, and after 60 days, the auto-close then closes out the ticket (sets status from Resolved to Closed) and from there, use the option "edit_inactive" to prevent the Closed ticket from being reopened.  The only thing to keep in mind is that a Resolved ticket remains "active" and can then be edited and acted upon like any other active ticket.

     

    The following suggestion is unsupported and we will not be able to assist in any further development of this concept:  

     

    If you are using the "Close" status and wish to maintain some functionality of allowing end users to reopen a ticket with status of "Closed", you could also create a script that would run on a periodic basis and sets a hypothetical customised field that flags if a ticket is over 60 days.  Script would run a pdm_extract of all tickets with the close date set to a certain value, then modify the extracted entries to turn on the hypothetical field, then use pdm_load to return the ticket entries.  You would then use a DP to control pre-updates based on the value of this hypothetical custom field.  



  • 4.  Re: Is it possible to hide reopen status from drop down in request order detail page if request order is older more than 60 days in CA Service Desk 12.9?
    Best Answer

    Posted Oct 05, 2017 12:16 PM

    Hi cbscoreteam,

     

    This requirement can be accomplished with a little bit of JavaScript.  Here's a working example.  In a test environment on the detail_cr form replace the status pdm_macro with the following lines, clear the web cache, and test.

     

    //Conditionally hide Reopen status if the Request was closed more than 60 days ago
    var zNow = Number(Math.round((new Date()).getTime() / 1000));
    var zClose_Date = Number("$args.close_date_INT_DATE");
    console.log("Close Date: " + zClose_Date + "\nNow: " + zNow + "\nClose Date plus 60 days <= Now: " + ((zClose_Date + 5184000) <= zNow));
    if((zClose_Date + 5184000) <= zNow && "$args.status" == "CL" && "$cst.access_type.sym" != "Administration"){
    <PDM_MACRO name=dtlDropdown hdr="Status" attr=status factory=crs_cr whereclause="code != 'RO'">
    }
    else{
    <PDM_MACRO name=dtlDropdown hdr="Status" attr=status factory=crs_cr>
    }


  • 5.  Re: Is it possible to hide reopen status from drop down in request order detail page if request order is older more than 60 days in CA Service Desk 12.9?

    Posted Oct 05, 2017 12:53 PM

    Doesn't seem to be working reliably, am working on an update.

     

    Edit: Updated code, it now appears to work fine.



  • 6.  Re: Is it possible to hide reopen status from drop down in request order detail page if request order is older more than 60 days in CA Service Desk 12.9?

    Posted Oct 05, 2017 01:56 PM

     CENTRAL BANK INDIA,

    Does this work for you?

    If so, please mark the answer as correct



  • 7.  Re: Is it possible to hide reopen status from drop down in request order detail page if request order is older more than 60 days in CA Service Desk 12.9?

    Posted Oct 11, 2017 04:19 AM

    Worked for me.

    Thanks a lot for all the support.



  • 8.  Re: Is it possible to hide reopen status from drop down in request order detail page if request order is older more than 60 days in CA Service Desk 12.9?

    Posted Nov 16, 2017 10:27 AM

    Hi cbscoreteam,

     

    I updated the JavaScript in my answer as I found that it still had issues setting the  zClose_Date variable and it also created an issue with the close_date field.  The update uses the close_date_INT_DATE attribute instead of close_date, which should be more reliable.



  • 9.  Re: Is it possible to hide reopen status from drop down in request order detail page if request order is older more than 60 days in CA Service Desk 12.9?

    Posted Mar 20, 2019 11:42 AM

    Used this to apply it to only the Employee role. Applied to the detail_in and detail_cr for the Employee role. Essentially hiding the Reopen button, if older than 30 days. Thanks for the guidance. 

     

     

    <!--Beginning of Disable Reopen on tickets older than 30 days-->
    //Conditionally hide Reopen status if the Request was closed more than 30 days ago
    var zNow = Number(Math.round((new Date()).getTime() / 1000));
    var zClose_Date = Number("$args.close_date_INT_DATE");
    console.log("Close Date: " + zClose_Date + "\nNow: " + zNow + "\nClose Date plus 30 days <= Now: " + ((zClose_Date + 2592000) <= zNow));
    if((zClose_Date + 2592000) <= zNow){

    }
    else{
    ImgBtnCreate("btn003","Reopen_Request", "reopen_request()", "defer", 0);

    }
    <!--End of Disable Reopen on tickets older than 30 days-->