ATF test steps for a Change Request to close a Change Task

Winnie P
Mega Sage

Hello there - I am developing an ATF test to approve a Change Request and I am almost there. I am the 'Implement' state, where we have a Change Task created - what ATF test steps can I use to change the Change Task state from Open to Closed complete please, is it possible? Thank you.

Steps I am trying, but failed:

find_real_file.png

Failed test step:

find_real_file.png

 

1 ACCEPTED SOLUTION

MD AQUIB KHAN
Giga Guru

Hi Winnie,

Since you are in the implement state . I am providing you the steps to open the change task and finally update /Close task. This is the use case scenario which I have created. Please find the details below.

 

1. Impersonate

2. Record Query: Here you will be querying the change record . Table :change_request. In conditions use the reference step when the change was created .

3. Open an Existing Record: Take the reference of the Step 2: Record Query 

4.Record Query:Here you will be querying the table:change_task and in Conditions

                      you have to take the reference using data pill picker as :Change request = {{Step 2: Record Query.First record}}.

5. Open an Existing record:Take the reference of the Step 4: Record Query. Table:change_task

6.Set Values: For Example:    State = Closed
                                           Description = task is closed.
                                           Close notes = closed

                                        

7. Click UI Action: UI Action:Close Task/Update.

8. Open an Existing record:Table will be change_task. Also taking the reference of the step 7:For Example: Open the 'Change Task' form with id '{{Step 7: Click a UI Action.Record}}'

 

Please find the screenshot below.

find_real_file.png

In the screenshot, you will not find the Impersonate steps as I was executing as admin.

Test Results:

find_real_file.png

 

Please let me know if any additional information is required.

 

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Winnie Poelima 

you will have to use sys_id of change_task record

In the step error it says failed to open as it didn't find sys_id

Which record sys_id you are giving there?

you should be giving the change_task record sys_id

Regards
Ankur

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

SebastianB
Tera Guru

Hi 🙂

I guess the issue with that is that you need to switch the steps "open an existing record" and "record query".

First you need to do the query like: change tasks where change request is STEP 8(SYS ID) and state = open

Then you can use the "open an existing record" step to refer to the query.

Kind regards

Sebastian

MD AQUIB KHAN
Giga Guru

Hi Winnie,

Since you are in the implement state . I am providing you the steps to open the change task and finally update /Close task. This is the use case scenario which I have created. Please find the details below.

 

1. Impersonate

2. Record Query: Here you will be querying the change record . Table :change_request. In conditions use the reference step when the change was created .

3. Open an Existing Record: Take the reference of the Step 2: Record Query 

4.Record Query:Here you will be querying the table:change_task and in Conditions

                      you have to take the reference using data pill picker as :Change request = {{Step 2: Record Query.First record}}.

5. Open an Existing record:Take the reference of the Step 4: Record Query. Table:change_task

6.Set Values: For Example:    State = Closed
                                           Description = task is closed.
                                           Close notes = closed

                                        

7. Click UI Action: UI Action:Close Task/Update.

8. Open an Existing record:Table will be change_task. Also taking the reference of the step 7:For Example: Open the 'Change Task' form with id '{{Step 7: Click a UI Action.Record}}'

 

Please find the screenshot below.

find_real_file.png

In the screenshot, you will not find the Impersonate steps as I was executing as admin.

Test Results:

find_real_file.png

 

Please let me know if any additional information is required.

 

Thank you MD Aquib Khan, this worked. Cheers!