ATF with REQ -> RITM (W/Approvals) -> SCTASK

John H1
Tera Guru

Our workflow requires the user to submit a catalog item that creates an RITM that is first approved by the department manager,  then approved by the IT manager and then assign the Tasks.

I'm new to ATF and I'm trying to understand how I can move from Catalog Item, to the RITM and finally to the SCTASK.

Any assistance would be greatly appreciated. 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@John H 

Steps for you to get started

1) Impersonate user
2) Open a Catalog Item
3) Set Variable Values
4) Order Catalog Item
5) Record Query - sc_request where SysId = Output from Step 4
6) Record Query - sc_req_item where Request = Output from Step 5
7) Record Query - sysapproval_approver where Approval - Output from Step 6; Give some timeout as 10seconds
😎 Open an Existing Record - sysapproval_approver where Sys Id = Output from Step 7; Give some timeout as 5seconds
9) Click UI Action "Approve" so that user approval is done
10) Record Query - sysapproval_approver where Approval - Output from Step 6 AND State is Requested
11) Open an Existing Record - sysapproval_approver where Sys Id = Output from Step 10; Give some timeout as 5seconds
12) Click UI Action "Approve" so that Group approval is done
13) Record Query - sc_task table where Request Item is Output from Step 6
14) Open an Existing Record - sc_task where SysId = Output from step 13
15) Click UI Action "Close Task" to close task
16) Open an Existing Record - sc_req_item where Sys Id = Output from Step 6
17) Field values validation - validate Stage = Completed

Regards
Ankur

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

View solution in original post

18 REPLIES 18

@John H 

Did you mistakenly marked your own response as correct?

Would you mind marking my response as correct if I was able to help you.

Regards
Ankur

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

John H1
Tera Guru

This has been a great to get me started with ATF. I'm having a problem that we have a requirement to complete the "Assignment Group" field before the second approval. We also have a requirement to add a Reason Code and Notes on closure of the Task (before clicking on the Close Task" button, I think if  I can get some help on the first item I can figure out the second item.

Thanks, 

Hi,

you can set the field state to close

Then in next step populate the reason code and notes

then click on close task

Regards
Ankur

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

John H1
Tera Guru

Where I running into trouble is I can't get the Assignment Group set for the second approval so the workflow will not create the SCTask.

I set the field value on step 11 but it fails on step 14 (I do not get the error until step 15 because the Task was not generated in the workflow.

1) Open a Catalog Item
2) Set Variable Values
3) Order Catalog Item
4) Record Query - sc_request where SysId = Output from Step 3
5) Record Query - sc_req_item where Request = Output from Step 4
6) Record Query - sysapproval_approver where Approval - Output from Step 5; Give some timeout as
     10seconds
7) Open an Existing Record - sysapproval_approver where Sys Id = Output from Step 6; Give some
     timeout as 5seconds
😎 Click UI Action "Approve" so that user approval is done
9) Record Query - sysapproval_approver where Approval - Output from Step 5 AND State is Requested
10) Open an Existing Record - sysapproval_approver where Sys Id = Output from Step 5; Give some
     timeout as 5seconds
11) Set Field Values - Set the following values on the form: Assignment group = “Assignment Group
        Name here”
12) Open Existing Record - Open the 'Approval' form with id '{{Step 9: Record Query.First record}}'
13) Click UI Action "Approve" so that Group approval is done
14) Record Query - sc_task table where Request Item is Output from Step 5
15) Open an Existing Record - sc_task where SysId = Output from step 14
16) Click UI Action "Close Task" to close task
15) Open an Existing Record - sc_req_item where Sys Id = Output from Step 4
16) Field values validation - validate Stage = Completed

Hi,

Can you give some timeout for Record Query Step 14 such as 10 seconds or 5 seconds

Possibly it is taking time to create sc task once group approval is done.

Regards
Ankur

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