Skip to main content
Closed for Voting

Time Entry as Note

Related products:Freshdesk
  • August 30, 2016
  • 8 replies
  • 22 views

I find that when I am working on a ticket, I am taking detailed notes of what I'm doing to resolve that ticket and also tracking my time.  I then put those notes in the Time Entry AND into a Public/Private Note so that it shows up in the ticket feed as well.


It would be awesome if there was a checkbox when entering in a Time Entry to "Also create a Public/Private Note" so that when I put my notes in the Time Entry, it also creates it as a Public or Private Note (hopefully we would have the option to choose for it to be a public or private note when making the Time Entry).


I hope this makes sense.  Thanks!

8 replies

Joshua,


Thank you for posting in our forums. We have written custom code (Fresh plug) that you can use to add a note while adding a  time entry. Please go to Admin> Apps > Custom apps tab > New custom app  and copy and paste the below lines. Do double check if display on ticket details page has been checked to enable the app on the ticket page. 


<style>

li.custom_checks {

    margin-right: 10px;

    float: left;

    list-style: none;

}  

</style>


<script type="text/javascript">

  jQuery(document).on("sidebar_loaded",function(event,data){

     jQuery("#triggerAddTime").live('click', function(){     

       setTimeout(function(){ 

         jQuery("#private_public_check, #add_note_custom_check").remove();

        jQuery("<li class='hide custom_checks'> <input type='checkbox' id='private_public_check'  class='' /> Private? </li>").insertAfter(jQuery("#timeentry_add"));

         jQuery("<li class='custom_checks'> <input type='checkbox' id='add_note_custom_check' class='custom_checks' /> Add Note? </li>").insertAfter(jQuery("#timeentry_add"));

        }, 600);

     });

    

    

    jQuery("#add_note_custom_check").live("click", function(){

      jQuery("#private_public_check").parent().toggle();

    });

    

    

    jQuery("#new_timeentry-submit").live("click", function(){

      debugger;

        var private_note = jQuery("#private_public_check:checked").length > 0 ? true : false;

      var add_note = jQuery("#add_note_custom_check:checked").length > 0 ? true : false;

      var body = jQuery("#time_entry_note").val();

      

      note = { "helpdesk_note": { "body":""+body+"", "private":private_note }}

        if(add_note){

      jQuery.ajax({

        url: "/helpdesk/tickets/{{ticket.id}}/conversations/note.json",

        type: "POST",

        contentType: 'application/json',

        data: JSON.stringify(note),

        dataType: 'json',

      success: function(data){

   window.location.reload();   

      },

        error: function(data){

           window.location.reload();   

      }

       

    });

    }

      

    });

    

  });

</script>


It should be simple to edit the code to always make the add note and private note checkboxes to be selected by default if you require it that way.  Let us know if you face any difficulty while setting this up. 


  • Author
  • Contributor
  • October 4, 2016

Hi Janani!


So, this seems to sometimes work.  It's a great feature, but I'm running into problems.  Please see the two attached screenshots for the problems I have when using this feature.


Thanks!


Sorry about that, Joshua!


If you replace the below line: [line no.13 ]

jQuery("#private_public_check, #add_note_custom_check").remove();


with:

 jQuery(".custom_checks").remove();


you shouldn't be facing the issue anymore. Let us know if this solves your problem.



  • Community Debut
  • March 16, 2017

This is a great script, I have been looking for something like this for ages  :) 


I do have a few requests though.  I understand everyone is very busy but I would be very grateful if it could be modified to do the following:

  • Is it possible to have the 'Add Note' & 'Private Note' options appear when editing a time entry and not just adding a time entry.  I ask because I often start the timer, go off and do the work, stop the timer and then enter my notes.  (I do this because you can't enter notes while the timer is running).

  • Also, as you suggested in the previous post, it would be great to automatically have the two check boxes already selected.

Again, any help to accomplish these would be very much appreciated.

Thanks in advance :)


This would be really helpful in maximizing time. Thanks, Janani for the script you gave. 


  • Community Debut
  • April 10, 2017

This is great input and it helps.

is it possible to increase the size of the Note Box, currently it has only two lines. I like to have at lease four lines or may be an option to detach the notes and make it full notepad


  • Community Debut
  • April 10, 2017

This is great script,

is it possible to increase two more lines in Notes field view, or an option to detach notes in full size notepad


  • Community Debut
  • May 22, 2018

This doesn't seem applicable anymore? Creating a new Custom App does not allow this content to simply be pasted you need to create an app type (server side?) and upload a 'package' of file - which takes a bit more knowledge then is covered here. Shame.