Approval requested notification not being sent for custom created "New Change Request" application

afofana
Kilo Explorer

I am trying to duplicated the current "Change Request" application for another organization to use.
So so far,
I've extended to the Task table, create the "New Change Request" application, build my form, copy all the business rules, client script, notification .. from the change_request table to new_change_request table.

I am having problem to fire off the "approval envents" business from my new change request form.

When a requestor submit a change in the "New Change Request" , a change ticket get created fine witht eh Approval field set to "Not Yet Requested" and a notification goes out fine.

So when the UI action "Request Approval" is click the Approval is set to "Requested" ,
a notification for Approval requested for was supposed to be sent but it doesn't.
Also no item get created under the Approvers table.

It looks like to me the "Approval events" is not getting fire off. Any idea what's wrong?

10 REPLIES 10

afofana
Kilo Explorer

I still cannot figure how a record get created in the sysapproval_apporver table when a change request is submitted.

For a record to get created I would have to to go to the Request Approval UI action on the "New change Request" table and add some code like this

var gr = new GlideRecord("sysapproval_approver");
gr.initialize();
gr.sysapproval = current.sys_id;
gr.state = "Requested";
gr.approver = current.u_approvers;
gr.insert();

so that the "approver events" get fired. It doesn't make sense.

Mark please help


cwilker10
Giga Expert

Typically with Change Requests the Approval is created in the workflow. I'm not sure how you have your system set up, but it is not a Business Rule level activity. Nothing says that you can't alter the OOB business rule for your application, but it's expected that you'll fire your Approvals in a workflow that gets fired when the Approval is "Requested". So I would check to make sure that you have a Workflow defined for your custom application to fire the Approvals. If you wanted to not use a workflow then you could just create the approval record from within an Insert/Update business rule. When I look at your example above, the u_approver"s" scares me. You would need to create an approval record for each approver.


afofana
Kilo Explorer

Thanks Chris for your reply.
Are you talking about the Comprehensive Change Workflow? For some reason that is set to Inactive even though it is published. Same in the demo instance.

So I've made a copy of all the 3 change request workflow to the new table and I don't get any approval record created. Is there anything am I missing?


cwilker10
Giga Expert

You need to make sure that the properties are correct on the workflow and at the approval is properly set up,I.e a valid user with an email address assigned.

-Chris