Compare field values from one record to field values on another record within same ATF

CSkaggs
Giga Contributor

 

We are using a custom application, Event Generator, that automates event generating. This lets you specify fields on an event and what they should populate with when you generate an event.

When an event is generated, a related Alert and Incident are created.

Our ATF is looking at the Alert generated from the Event and the Incident.

When we look at the Incident (from Event -> Alert), we are wanting to compare the following:

For Incident:

  1. Incident generated for the Alert.
  2. Fields that should populate:
    1. Short Description (same as Description on Alert).
    2. Description (not empty).
    3. Alert Source (same as Source Instance on Alert).
    4. Parameter (same as Metric Name on Alert).
    5. Object (same as Resource on Alert).
    6. Object Class (same as Type on Alert).
    7. Alert Reference (not empty).
    8. Assignment Group (not empty)

How do we compare the Incident Short Description, for example from above, to the related Alert Description?

When the Test Step, Field State Validation, is used for Step 10, the Input Value Icon only lets me select the actual record from before and the tree picker hierarchy never appears. You are only able to select the record and cannot compare fields on one record to another.find_real_file.png

Does anyone know how to do this comparison?

Here is how this has been built, up to this point. If I have done any of the Test Steps incorrectly, please let me know.

find_real_file.png

2 REPLIES 2

lucascd
Giga Contributor

I used to have a similar question here and found an answer - maybe it can help you. In my case the verification was for one field only.

 

To do that I used a Run Server Side Script with a piece of code that would have as Output the value I wanted (in my case, it was a sys_ID of a CI. But it can be any field you want, I already used with Name field as well).

Look at the accepted solution: https://community.servicenow.com/community?id=community_question&sys_id=5a10da8ddb97f780d58ea345ca9619ce

 

For your case I believe you would need to have one Run Server Side Script step per value you want to compare, since I assume it is not passible to have more than 1 output per test step.

 

 

 

 

CSkaggs
Giga Contributor

This may be aiming me in the right direction. I will follow-up. Thank you!