Approval not generated through workflow

Ashwini Jadhao
Giga Guru

Hi,

I had created workflow to send approval to user but the approval not generated.same things are working on the Personal Instance.but not on the client's instance.

the workflow not attached to the Incident table.

I gone through the  link as https://community.servicenow.com/community?id=community_question&sys_id=c1c013a9dbdcdbc01dcaf3231f96...

but it is not working.

1 ACCEPTED SOLUTION

AbhishekGardade
Giga Sage

Hello Ash,

As I understood, You need to create approvals in approval table and send it to the approvar with the help of business rule, right?.

Also for which table you need to generate the approval? RITM ? Incident? or what else?

I have created approval from business rule:

1. Business rule config:

2. Script:

var grApprover = new GlideRecord('sysapproval_approver');
grApprover.initialize();

//below fields are available on approave table (sysapproval_approver)
grApprover.state = 'requested'; // setting state to requested

// Here you can set who will be the approvar.
grApprover.approver = current.request.requested_for.manager;

// here you can specify for which record you need to generate apporval
grApprover.sysapproval = current.sys_id; 
grApprover.insert();

Please mark as Correct Answer/Helpful, if applicable.
Thanks! 
Abhishek Gardade

Thank you,
Abhishek Gardade

View solution in original post

5 REPLIES 5

Jyoti8
Kilo Guru

Thank you for your reply .

But on the Dev instance some rules are applied on the workflow that's why it is not attaching to incident table. And They wont permit me to change it.

Can you please tell me how to write business rule to send approvals and tasks for incident table 

Try these links to send approvals by using business rule.

https://community.servicenow.com/community?id=community_question&sys_id=7ecee5f9db72df40f7fca851ca96...

 

https://community.servicenow.com/community?id=community_question&sys_id=7ecee5f9db72df40f7fca851ca96...

 

If I have answered your question, please mark my response as correct and/or helpful so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

AbhishekGardade
Giga Sage

Hello Ash,

As I understood, You need to create approvals in approval table and send it to the approvar with the help of business rule, right?.

Also for which table you need to generate the approval? RITM ? Incident? or what else?

I have created approval from business rule:

1. Business rule config:

2. Script:

var grApprover = new GlideRecord('sysapproval_approver');
grApprover.initialize();

//below fields are available on approave table (sysapproval_approver)
grApprover.state = 'requested'; // setting state to requested

// Here you can set who will be the approvar.
grApprover.approver = current.request.requested_for.manager;

// here you can specify for which record you need to generate apporval
grApprover.sysapproval = current.sys_id; 
grApprover.insert();

Please mark as Correct Answer/Helpful, if applicable.
Thanks! 
Abhishek Gardade

Thank you,
Abhishek Gardade