Fetch RITM number using ATF

admin11345_
Tera Contributor

Hi All,

 

This is related to ATF.

 

I have submitted the form after making some changes using ATF. RITM got generated. How to get the RITM number ?

How to write an ATF step to fetch that RITM number ?

 

6 REPLIES 6

Dipen Wadhwana
Giga Guru

Hi @admin11345_ ,

 

Please refer the below link. 

https://www.servicenow.com/community/now-platform-forum/atf-unable-to-fetch-ritm-number-in-test-step...

 

Here is the script. Please replace the SYS_ID of the test step accordingly:

(to get the sys_id open the Record Query on sc_req_item table test step, and copy sys_id from context menu like we do in normal forms.)

(function(outputs, steps, stepResult, assertEqual) {
    // add test script here
	var gr = new GlideRecord("sc_req_item");
	gr.get(steps('**sys_id of TEST STEP that has the RITM sys_id').record_id);
	outputs.table = 'sc_req_item';
	outputs.record_id = gr.getValue('number');
	stepResult.setOutputMessage(gr.getValue('number'));
	 })(outputs, steps, stepResult, assertEqual);

 

Please mark it helpful if it helped you.

Shaqeel
Mega Sage

Hi @admin11345_ 

 

You need to go step by step:

1. Open new Req form.  

2. Enter the fields value.

3. Submit

4. Open the Req record submitted. (Open existing record)

5. Apply filter to the list (Select list type as related list and add condition)

6. Open existing record>>step 5

YOUR RITM WILL GET OPEN.

 

You can use Record Query step too.

set the table to requested item

apply filter condition as created as today.

RITM is ......

or short discription is ......

 

and open using open existing record step.

 

Regards

Shaqeel

 


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel

Ankur Bawiskar
Tera Patron
Tera Patron

@admin11345_ 

what's the next step after getting the RITM number?

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

step 1):- I have submitted a employee form

step 2):- As a result of it, RITM record gets generated in one of the related list tab.I need to validate whether RITM is getting generated or not.

step 3):- If generated, fetch the RITM number.

step 4):- open that RITM record.

 

 

I have submitted the form. But I need steps for remaining steps through ATF.