Updating Password using REST

david_jones
Kilo Contributor

- Create a Service Catalog

- Take two variables

        User Name - Reference [sys_user]

        New Password - Single Line Text

- On Order Now Button

- Using REST message on another instance selected user name should set the new password.

--------------------------------------------------------------------------------------------------------------------

so i have tried doing fields other than password all fields get fixed but password field is not getting set.

so can anyone please assist me for this problem.

4 REPLIES 4

jberk
Giga Expert

Make sure you are setting the display value on the password field in your code or the change won't take.


india
Tera Guru

#make sure you have made an outbound message !!


#make sure patch method is used with appropriate sys_id !!


#make sure in Patch query parameter write name: sysparm_input_display_value   Value :true


then after


put this business rule on requested item



var r = new sn_ws.RESTMessageV2('PasswordResetter', 'PATCH');


r.setQueryParameter('sysparm_input_display_value',true);


r.setStringParameterNoEscape('user_password',current.variables.YOUR PASSWORD VARIABLE NAME);


var response = r.execute();


var responseBody = response.getBody();


var httpStatus = response.getStatusCode();


Thanks alot sir...


snow123
Kilo Contributor

Hi,

        Can i have step by step process with config and background scripts code.

 

Regards,