7 Replies · Latest reply on Jan 4, 2018 5:42 AM by dvp

    Additional comments from RITM to SCTask

      Hi Community,

       

      I want to know if is possible see the Additional comments posted(activity) on RITM into SCTask form.

      In our setup, if the SCTASK owner posts to Additional Comments it goes to the Client. Then the client posts a response but it only goes back to the RITM, as our clients respond using RITM form from Portal.

       

      Thanks

      Lex

        • Re: Additional comments from RITM to SCTask
          Kristen Ankeny

          You can add a business rule to add the comment to the sc_task(s) under the RITM. You'll need to add something in to prevent a loop where the task updates the ritm with a comment, which triggers the ritm to update the task, and so on. We did this by prefacing the comment from Tasks with "Update from Task" and prefacing comments from RITMs with "Update from Requested Item". Then in the in business rule, it should use indexOf to check for "Comment from Task" (on ritm rule) or "Comment from RITM" (on task) and stop if it's found, otherwise, push the comment with the preface. This is the code on our business rule on the task table:

           

          (function executeRule(current, previous /*null when async*/) {

           

          str = current.comments;

          var pos = str.search('Update from Requested Item');

           

          if(pos == -1){

          //gs.info('The push from Task to RITM will trigger now: ' + current.comments);

          var gr = new GlideRecord('sc_req_item');

          gr.get(current.request_item);

          gr.comments = 'Update from Task "' + current.short_description + '": ' + current.comments;

          gr.update();

          }

          else{

          //gs.info('I will not push this comment from Task to RITM: ' + current.comments);

          }

           

          })(current, previous);

            • Re: Additional comments from RITM to SCTask
              Lex Diaz

              Thank you Kristen.

               

              I was using a similar business to copy the comments from SCTask to RITM, and now my dilemma was to copy the comments from RITM to SCTask without falling into a loop.

               

              I create a BR with your code, but I am not sure if I am doing fine, here I did:

               

               

               

              I am not a development expert, so what else do I need to do? Should I create another similar BR to copy the comments from RITM to SCTask as well, right?

                • Re: Additional comments from RITM to SCTask
                  Kristen Ankeny

                  In our company we have a business rule on sc_task and one on sc_req_item. This allows us to keep things segregated: The end users view and receive notifications from the RITM; people working to fulfill a request view and receive notifications from the task. To simplify the communication, if the end user adds a comment to the RITM (either through replying to an email they received or just adding a comment to their request), we copy to the task(s) for the people working the request. Then, if the person working the ticket updates their comments, it copies to the RITM so that the end user will receive an email and be able to view the comment if they open the ticket. Your specific business rules will depend upon how you are handling the communication. I'm not sure if the current comments on your tasks are triggering an event for the sc_req_item table and including the comment that way, or if the comment is already being copied to the RITM and thus triggering the email to your end user. Your original request looks like you want to copy the end user comment to the task - so, you would add a business rule to the ritm, reverse of the example above.

                  1 of 1 people found this helpful
                    • Re: Additional comments from RITM to SCTask
                      Joshua Holcomb

                      We are doing something similar,

                       

                      The differences that we are doing is that I have made it so that you can only enter comments on the request item and work notes on the sc tasks. The reasoning behind this is that to us request items are for the end user and tasks are for the workers. So if a worker wanted to communicate to a end user, then they needed to do it on the request item, its a little inconvenient for the work but it makes it friendlier to the end user. What I did add the person in the assigned to field on the sc task to the request items additional assignee list.

                      1 of 1 people found this helpful
                • Re: Additional comments from RITM to SCTask
                  dvp

                  you can also write a notification on RITM to send updated comment info to fulfillers