i have to make a child database with a relationship but i dont know how to make it

Enovella23
Tera Contributor

in the script the use a similar script for depends on used by business service it looks like this:

gs.getProperty("relationship.dependson.usedby")

but i need one to runs on runs to server i try something like this 

gs.getProperty("relationship.runson.run");

but this is not working, someone have make something similar?

 

1 ACCEPTED SOLUTION

Hi Evonella, 

I thought maybe a demonstration may help on the above so hope this video helps.

https://youtu.be/QLQHzARFqJ4

Please mark this as helpful if it helps your question. 

Regards,
Wind

View solution in original post

Supporting this question on the Now community to help define the difference between property and a record in a table (Ci Relationship Type) https://www.servicenow.com/community/sam-forum/i-have-to-make-a-child-database-with-a-relationship-but-i-dont/m-p/2895963#M13928
6 REPLIES 6

Wind0004
Mega Guru

Hi Enovella, 

What is the name of the script you are referring to ? Is it an OOTB script ?
I cannot seem to find any property by the name "relationship.dependson.usedby". 

Regards,

Wind

Enovella23
Tera Contributor

is a custom script someon write but it work, i think this get the sys_id of the relationship and then it allow me to create the relation on cmdb_rel_ci table using the type dependson.

but when i try ti get the id of the relationship runs on the value is null

Hi Evonell,

 

Right that makes sense now.

 

So I believe you would have to create new system property , add the sys ID to the property and then your script should work. 

Property ; relationship.runson.run 

add the sys id of the above 

 

and then reuse the functionality of the script with the new sys id.

 

let me know if you have any further questions 

 

regards,

Wind

the relation ship exist in fact, is an ootb relationship, but when i try to get the sys id with this script:

var relatioship1 = gs.getProperty("relationship.runson.runs"); // Depends on::Used by
this return null, 

Enovella23_0-1712922867545.png