Need to update WorkNotes

Indup
Tera Expert

Hi all,

I am creating a request from inbound action. Also i am calling a workflow from it. In that workflow, after begin activity i have created a catalog task activity. After that activity some custom activity is there. Once that custom activity completes, i want catalog task work notes to be updated . How can i do this?

I tried with:   Begin --> Catalog task activity --> Custom activity ---> Run script ---> End

 

 

Run script:

var gr = new GlideRecord('sc_task');
gr.addQuery('request',current.number);
gs.log("current sys id is "+current.sys_id);
gr.query();
if(gr.next())
{
gr.work_notes = "abc123";
gr.update();

}

But not updating the catalog task work notes. 

Can some one help me here

 

Regards,

Indup

9 REPLIES 9

Allen Andreas
Administrator
Administrator

Hi,

This could be handled a multitude of ways:

-Through onSubmit client script of that catalog item > task to write to the work notes -- but would apply to all catalog tasks within this flow unless you use something like the short description to check if that task is one that should have the work notes updated.

-Through business rule and using conditions like item is 'x' and task short description is 'y'.

-Or...a more isolated way is to add this to your task activity, in the advanced/script section:

workflow.scratchpad.taskID = task.setNewGuid();

Then in the run script after this task, sort of like what you did...you'd use code:

var gr = new GlideRecord('sc_task');
gr.addQuery('sys_id', workflow.scratchpad.taskID);
gr.query();
if(gr.next()) {
gr.work_notes = "abc123";
gr.update();
}

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

HI Allen,

 

Thank you very very much. It worked fine. Thanks a lot. Have a great day!!!

 

 

Regards,

Indup

Hi,

Great. Please mark my reply above as Helpful and Correct.

This helps show others the answer quickly and marks your post as resolved.

Thank you


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi again,

Please mark my reply above as Correct. This helps others in the community see the correct answer (at least for you) easily.

Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!