ATF validate prb # is referenced in the inc notes (ATF validate a dynamic number in a field)

Ashley45
Tera Contributor

I created an INC with a related Problem record. Once I closed the PRB and the INC the resolution notes auto populate as shown 

Ashley45_0-1724171871998.png

How can I create a validation the PRB# is in the resolution notes since it is dynamic?

I tried a field value validation -

Ashley45_1-1724172041609.png

 

 

8 REPLIES 8

Hemanth M1
Giga Sage
Giga Sage

Hi @Ashley45 ,

 

1)Create a custom step to fetch the problem number on the incident 

2)Compare using Form field validation

 

To create custom step

1)go to Automated test framework >Step configuration

HemanthM1_0-1724175968294.png

2)name the step and define input and output variables

ex:

HemanthM1_1-1724176026724.png

 

Inputs

 

HemanthM1_2-1724176049907.png

Output

HemanthM1_3-1724176076879.png

 

Add this script in the step execution script 

HemanthM1_4-1724176116759.png

 

Now add to your ATF step

HemanthM1_5-1724176177484.png

Result:

HemanthM1_6-1724176213396.png

 

Hope this helps!!!

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

@Hemanth M1  For the Problem Number test step what is your input for the ID? are you using the data from the opening problem record?

Ashley45_0-1724180970966.png

 

Hi @Ashley45 ,

 

1)Open a created record (incident created) if can't do record query

2)Input to the Problem records are table and sys_id of the incident

HemanthM1_0-1724222560198.pngHemanthM1_1-1724222592169.png

How to map them in ATF step

Input:

HemanthM1_2-1724222689727.png

Output:

Output variable is count, you can rename it anything.

HemanthM1_3-1724222736275.png

 

Hope this helps!!!

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

@Hemanth M1  Also i cannot do a record query on this test. This test creates and INC then creates a problem in relation to the INC. It's always going to be a new number, same issue that i'm having with the PRB #