Client script to set resolved by as current user

Alon Grod
Tera Expert

Hi,

 

I have the field 'resolved_by' and I need to set it as the current user (the user that is taking the action of changing the state) when the state change to resolved.

Can anyone please help me how do I write the onchange client script

1 ACCEPTED SOLUTION

Anubhav Ritoli2
Mega Expert

Hi @Alon Grod 

 

Resolved By is already auto populated OOTB when Incident or Problem is Resolved by current user. 

 

If you want to make it happen for any other table, its recommended to use Business Rule instead of Client Script.

 

Condition: State changes to Resolved

When : After Update

 

Code:

 

current.resolved_by = gs.getUserID();
current.update();

 

 

 

View solution in original post

3 REPLIES 3

Ct111
Tera Sage

Similar thing has been discussed here .

 

I hope this LINK helps

Anubhav Ritoli2
Mega Expert

Hi @Alon Grod 

 

Resolved By is already auto populated OOTB when Incident or Problem is Resolved by current user. 

 

If you want to make it happen for any other table, its recommended to use Business Rule instead of Client Script.

 

Condition: State changes to Resolved

When : After Update

 

Code:

 

current.resolved_by = gs.getUserID();
current.update();

 

 

 

Hi,

Im trying to do this for sc_req_item and sc_task tables, so should I use a BR with script? if yes can you plesae help with the script