Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get the parent fields value into the fix script?

Pratiksha_kadam
Tera Contributor

Hi Community,

I have created one field 'Display name' on  'cmdb_ci_business_capabilty' table which shows level and name of capability together. 

I am writing a fix script to change the display of all capabilities, 'Display Name' of a capability where parent is not empty ,The display name should be in below format:

"Display name of parent+ Display name of child".

It means display name works to show the hierarchy of capabilities.

1 ACCEPTED SOLUTION

@Pratiksha_kadam 

You can simply pull by dot walking,
lets say you are declaring the object as grCapability, then your code would be

grCapability.parent.u_display_name //check for the correct backend name of the field

 

Best Regards
Aman Kumar

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Pratiksha_kadam 

unless you share what script you tried, we cannot help.

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