Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to add close notes in RITM if once state changes to closed complete in workflow

thanuja
Kilo Contributor

Hello Community,

As per my requirement there will be a task generated to security team and then user will get added to ad group . If once ritm state changes to closed complete then close notes should get updated. Please help me with this. Which activity i need to give in workflow , so that close notes of ritm will get updated . 

script i have written :

var req_for = current.request.requested_for.getDisplayValue();
ritm.work_notes = ' User ' + current.variables.requested_by_zid + ' has been added to ' + current.cat_item.group.getDisplayValue() + ' as requested.

Please help me with this , once ritm gets closed complete then close notes should get updated.

Thanks,

Thanuja.

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

What is your issue here?

You can leverage your Run script activity to update the work notes or close notes.

Instead of ritm.work_notes use current.work_notes

Copy as is:
var req_for = current.request.requested_for.getDisplayValue();
current.work_notes = ' User ' + current.variables.requested_by_zid + ' has been added to ' + current.cat_item.group.getDisplayValue() + ' as requested.

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

 

Best Regards
Aman Kumar

View solution in original post

7 REPLIES 7

Then add the Run script activity post "Set Values" - Completed activity just before end activity

Best Regards
Aman Kumar

@Aman Kumar 

after testing while adding user to ad group , it's showing error . Can you please say where exactly the error is . Please help me with this . Refer the attachments .

Share the screenshot of your script

Best Regards
Aman Kumar