Relationship between the contract and the CI

jaouad_essabir
Mega Contributor

Hello,

I wanted to import a relationship file between contracts and CI, but I'm stuck.

In the "cmdb_rel_ci" table, we have the two elements used in transforme MAP
Parent --> type = CI configuration
Child --> type = CI configuration

I have already imported the table contract "ast_contract"

In the relationship file which i want import, I have:
The parent = an item of CI -> so ok
The child = an item of contract -> not KO, so I created a new field in the relationship "cmdb_rel_ci" table "child contract" that references the table "ast_contract"

And I created a transform MAP using the fields:
Parent, type, child contract
instead of
Parent, type, child

The file is well imported, except that the graph display of relationships, I can't find the contract associated with a CI.

we have also, two columns "child" for relation with CI and "child contract" for relation with contract

find_real_file.png

when i displayed the graphe, i didn't find the contract, may the graphe take only the column "child"

find_real_file.png

Any help please ?

Best Regards

11 REPLIES 11

Robbie
Kilo Patron
Kilo Patron

Hi,


SN provides a relationship table between Contracts and CI's - "ast_contract_instance". Rather than update the cmdb_rel_ci table (which is intended for CI to CI relationships and I wouldn't recommend updating this table), I'd leverage the "ast_contract_instance" table. (See below)


These relationships are also available as a Related List at the bottom on the Contracts page and can be reported on etc.



contractCiRel.PNG



Thanks,


Robbie


Michael Fry1
Kilo Patron

Maybe take a look at Service Contracts (ast_service) where you can define CI's on a specific service contract: Defining a Service Contract - ServiceNow Wiki


jaouad_essabir
Mega Contributor

Thanks for your response.


I found this solution yesterday, but the contract associeted to CI dosen't displayed in the MAP of the CI, have you any idea ?


So, we can see the CI in the contract but not the contract in the CI MAP ?


Robbie
Kilo Patron
Kilo Patron

Hi Jaouad,


The 'Related Items' section and CI Map (also known as the BSM Map) only displays relationships between CI's (as defined in the cmdb_rel_ci table).


As contract is not of type CI, this will not be displayed.


I haven't dug too deeply in the Contracts module, but what is the requirement here? Contracts should be visible on the 'Related Items' and 'Map'? Is it all types of contracts? Whats about Software Licenses? Is this what you're trying to display?


Robbie