How to add manual approvals in change request form

raj99918
Tera Contributor

Hi Team,

 

How to add manual approvals in change request form for normal type of change requests and sent out an email after approval task is manually added 

 

Thanks

Raj

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Raj,

I believe out of the box New button is disabled on "sysapproval_approver" table so you cannot create it from front end.

you can use script to create manual approval for change request as below

Sample script

var gr = new GlideRecord('sysapproval_approver');
gr.initialize();
gr.state = 'requested';
gr.approver = gs.getUserID();   //Replace with user sys_id you want here
gr.sysapproval = 'change request sys id';
gr.insert();

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Raj,

I believe out of the box New button is disabled on "sysapproval_approver" table so you cannot create it from front end.

you can use script to create manual approval for change request as below

Sample script

var gr = new GlideRecord('sysapproval_approver');
gr.initialize();
gr.state = 'requested';
gr.approver = gs.getUserID();   //Replace with user sys_id you want here
gr.sysapproval = 'change request sys id';
gr.insert();

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Jaspal Singh
Mega Patron
Mega Patron

Hi Raj,

 

The option will be available unless it is disabled from the Related list. Check it one by following below steps.

find_real_file.png

In addition, once an approval record is added it will trigger a notification unless OOB notification for Approval table is not customized.

Harish Vaibhare
Kilo Guru

Hi,

1. create business rule on change request table and specify insert/ update according to your requirement and give condition type is normal in condition builder.

2. write above code in script section of business rule.

3. to send notification immediately after approval,you can use

gs.eventQueue('event_name',current,parm1,parm2);

// create notification and event to use above method.

 

Kindly mark helpful and correct if it is useful.

Thanks.

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@raj99918 

Hope you are doing good.

Let me know if that answered your question.

if you think there is any response that helps you please mark that helpful or accepted so that this thread can be closed.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader