copy comments from one task to another task

SnowDEV2
Kilo Expert

I have a requirement where I need to copy the comments entered in the first task to next task..

I have created a BR but no luck.. could anybody please help on this.

 

BR: push comments

when: before insert/update

 

script:

 

var gr = new GlideRecord('sc_task');

gr.addQuery('parent',current.sys_id);

gr.addQuery('short_description', "xyz");

gr.query();

while (gr.next()) {

            var num = current.number;

          gr.comments = current.comments.getJournalEntry(-1);

          gr.update();

 

    }

8 REPLIES 8

Completely agree, Doug!   I have actually run into exactly that situation in the past and used the workflow scratchpad as you indicate to solve it.  


Slava Savitsky
Giga Sage

Here is an alternative solution you may find helpful:


Instead of copying comments from one task to another, consider adding sc_req_item.comments field to the sc_task form. This way people will be able to add comments from the catalog task form but all comments will actually be stored at the requested item level and will be visible in every task within the requested item.


SnowDEV2
Kilo Expert

thanks a lot for all your help


my code is wrkng..:)


awesome please mark this one as answered so people will know the solution is there and if you would mark the post that fixed it for you as the correct answer.