How to update Asset worknotes through workflow runscript

Rini1
Tera Guru

Hi team,

I have added a runscript in a workflow which updates the state and Assigned to when the Ritm is closed complete. Now I would like to update the worknotes field to runscript and I have added a line to it. But it isnt working and not sure why.

Attached the script for reference. Any help would be much appreciated.

 

Thanks

Rini

1 ACCEPTED SOLUTION

Hi Mark,

The script had the below line and updating it to true sorted the issue. Thanks for your help 🙂

gr.setWorkflow(false);

 

Kind regards

Rini

 

 

View solution in original post

5 REPLIES 5

Mark Manders
Mega Patron

Are the other fields updates as expected, and is it just the work notes not being updated, or is the entire update not running?

If it's just the work_notes: do you have these on the form? OOB they are hidden. It shouldn't matter, but you never know.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

It doesnt update only the worknotes and this field (work_notes) is available on the form.

 

Thanks

If it's just the worknotes field, try it without the number, just the string. It could be that the number can't be found and that returns nothing at all. If that does update the worknotes, check if current is available, request is the correct field and try 'number.getDisplayValue()' instead of 'number'.

 

You can also put logs in your script:

gs.log("REQ Number: " + current.request.number);

gs.log("Work Notes: " + gr.work_notes);

These logs will show you what the script is having as output.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Hi Mark,

The script had the below line and updating it to true sorted the issue. Thanks for your help 🙂

gr.setWorkflow(false);

 

Kind regards

Rini