ATF opening a record created by clicking UI action.

Srikanth Menava
Kilo Sage

Hello SNC,

 In to the story, I created an INC and on the incident i am clicking on UI-Action 'create outage' which has to create an outage record in cmdb_ci_outage. My test is running fine untill this step but the I am not able to open the record, I am getting the following error.

FAILURE: Failed to open the 'cmdb_ci_outage' form with id '371745b68762e550c540c916cebb35a4'
Table 'cmdb_ci_outage' does not have a record with id '371745b68762e550c540c916cebb35a4'

 

below(attached)is the test result,ATF-SNC.PNG

 

has anyone faced it, FYI, I build other steps and same approach worked for othr and not for this, can anyone tell why?

1 ACCEPTED SOLUTION

I was able to figure it out myself.I created a submit record step after clicking the UI action.

Then the record was saved to the data base and was able to query for the record.

I followed the below approach..

SrikanthMenava_0-1684347909901.png

My test was success now.

View solution in original post

18 REPLIES 18

Ankur Bawiskar
Tera Patron
Tera Patron

@Srikanth Menava 

Please use record query step first on cmdb_ci_outage table with filter condition as Task number = Output of Submit a Form step

Then use Open an existing record step and set Record as the output of Record query step

something like this

AnkurBawiskar_0-1683550272274.png

 

AnkurBawiskar_1-1683550314587.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Thanks for the response @Ankur Bawiskar 

SrikanthMenava_0-1683568010682.png

tried it but the test failed.

SrikanthMenava_1-1683568155748.png

failed at following step 

SrikanthMenava_2-1683568271058.png

 

 

@Srikanth Menava 

try to give some timeout for Record query step which checks outage table

Give timeout of 10-15 seconds and then check.

 

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

@Ankur Bawiskar 

The time out was added earlier but I didn't have that row on the list.

SrikanthMenava_0-1683636552464.png

additionally, In the run script step I wrote the below piece of code.

But it didn't worked so I made it false.

 

var secondsValue = 90;
var seconds = parseInt(secondsValue, 10) * 1000;
var start = parseInt(new Date().getTime()) + seconds;
while(start>parseInt(new Date().getTime())){

 

@Srikanth Menava 

does that user have read access to outage table? if not then it will throw error

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