Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Closing required comments

How to make it mandatory  "Reason for status change"

Currently its optional  

Comments

  • Please help us to help you by reading and following the posting guidelines located in this thread: Please read before requesting assistance.  The more information you give us the better we will be able to assist you. Thank you.

    No idea what your asking.
  • While changing the status of a ticket from top menu (change status drop down)
    We can see two Fields in the popup (screenshot attached)
    1st one is Drop-down list to select the Ticket Status
    2nd one is Text area (long) to enter internal note which is optional,
    I want to make this internal note ( Text area) is required to change the status of the ticket.
    Pls guide us how to do.
  • osTicket Version v1.10.1 (9ae093d)
  • I do not think that there is a way to do that in the UI.

    What you can do is add a field to ticket details.  And make it require before close.
    But then the agent would have to edit the ticket to populate the field before being able to close the ticket.
  • I do not think that there is a way to do that in the UI.
    Can you please suggest any change in code..?
    We can manage PHP or Javascript. 
  • For the status changing dialog these are the lines for the visual: https://github.com/osTicket/osTicket/blob/55dc25ace736baeaf224ee608cfabc0218022036/include/staff/templates/ticket-status.tmpl.php#L85-L90

    you need to add a check on $_REQUEST['comments'] to see if it's empty and if it's empty throw an error.
    So maybe something like: 
    if(empty($_REQUEST['comments']))
        $errors['err'] = __('A comment is required.');
  •  I have added the code after line 901: But not wokring. With out any error message tickets status is changing 

            if(empty($_REQUEST['comments']))
        $errors['err'] = __('A comment is required.');
    //----------
            $state = strtolower($status->getState());
          
            if (!$errors && $ticket->setStatus($status, $_REQUEST['comments'], $errors)) {
                if ($state == 'deleted') {
                    $msg = sprintf('%s %s',
                            sprintf(__('Ticket #%s'), $ticket->getNumber()),
                            __('deleted sucessfully')
                            );
                } elseif ($state != 'open') {
                     $msg = sprintf(__('%s status changed to %s'),
                             sprintf(__('Ticket #%s'), $ticket->getNumber()),
                             $status->getName());
                } else {
                    $msg = sprintf(
                            __('%s status changed to %s'),
                            __('Ticket'),
                            $status->getName());
            
  •  class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext';
                                ?> no-bar small"
    I removed this from HTML
    Now validation is working.

    otherwise “print "comments length ".strlen($_REQUEST['comments']);  = comments length 4


  • If I change the ticket status from search Page Like :
    http://mydomain.org/support/scp/tickets.php?a=search&search-type=&query=23230SA

    Above Validation is not working which is placed at (line 858) function setTicketStatus.

    Please advise at which function I have to add validation

Sign In or Register to comment.