Automate Change Request and Approval Process using ATF

mhoughton
Kilo Explorer

So I'm trying to develop an ATF that automates the change request process through all of the necessary steps until the request is closed in the end.

So far, I have been able to impersonate a user to open a change request form, fill in all necessary fields, and submit the form for approval. Now the next step would be to impersonate the necessary approver and open up the record to approve the request. I have tried multiple different test steps to try to simulate this step but keep running into issues. The problem is is figuring out a way to simulate the approver to open up the same change record that was submitted in the previous process. Does anyone have any experience doing something similar to this? I figured that with request approval being so neccessary, someone in the community has to of figured out how to simulate this whole process, Thanks!

23 REPLIES 23

Table you should be referencing is [change_request]



Regards


JD37
Giga Expert

Not too sure if i'm too late to the party here but i've managed to get the Approval and subsequent CAB approval working. Happy to share if you're still looking for an answer.



Regards



Dos


Dean Berry
Mega Contributor

Hi Dos!



How were you able to add approvers to the change that was created? We are struggling with the correct method for this since it is on the sysapproval_approver or sysapproval_group table(s) and references the change. Any help is appreciated.



Thanks!


Hi Dean,



The approval steps I created once I had created a Change and it was in a State of Assess were as follows



Step 😎 Record Query -


There should be at least one record in 'sysapproval_approver' matching a query of


Approving = {{Step 7: Submit a Form.Record}}


and State = Requested


Table - Approval [sysapproval_approver]


Conditions - Approving = {{Step 7: Submit a Form.Record}} and State = Requested



Step 9) Open an Existing Record -


Open the 'Approval' form with id '{{Step 8: Record Query.First record}}'


Table - Approval [sysapproval_approver]


Record - Step 8: Record Query>First record



Step 10) Click a UI Action -


Confirm that browser submits 'Approval' form to server when clicking UI Action 'Approve'.


Table - Approval [sysapproval_approver]


UI Action - Approve


Assert Type - Form submitted to server



The above steps were repeated for the second CAB approval. On the second record query the first Approval record for the Change in the Approval [sysapproval_approver table was ignored as it didn't meet the criteria since the status on this had subsequently changed to Approve/Approved, and we're specifically looking for a record matching State = Requested



Hope it helps - let me know how you get on.



Regards



Dos


reza
Kilo Contributor

Hi Rajendra,




I might be late on this, but I have used the below steps to produce a change and move it forward in state. Hope the Screen shot below gives you an idea




create ATF change.png



For the approval process, As Dean has described, make sure that:


  • The person you are impersonating has approval role
  • When setting up the Open an Existing Record to approval form, make sure you also add the "default" view. I didn't do this at first, and got an error and the change did not go through the approval process.




BR


ARS