CA Service Management

  • 1.  Import contact to CI

    Posted 06-03-2016 03:35 AM

    Import_to_other contact.png

    Hi Team,

     

    Possible to import contact to CI Contact List. Please see screenshot in attachment.

     

    Please help advice for this case.

     

    Thanks,

     

    TK



  • 2.  Re: Import contact to CI
    Best Answer

    Posted 06-03-2016 11:36 AM

    Hi,

     

    You can load this data using pdm_load.  The load file format would look like this.

    Usage example: pdm_load -if <file>

    ____________________________________________________

    TABLE usp_lrel_cenv_cntref
          nr cnt last_mod_by tenant
    
    
        { "05C958F3D3A87343B976F75BF20354BB",
        "60AE21DCD76CD342BE08BA065FAE0B52", "60AE21DCD76CD342BE08BA065FAE0B52",
        "" }
        { "AF21864E17CB454CB47DC1E987E92819",
        "60AE21DCD76CD342BE08BA065FAE0B52", "60AE21DCD76CD342BE08BA065FAE0B52",
        "" }
        { "B4140ED97BF78249A52DAD5DB50ABF6E",
        "60AE21DCD76CD342BE08BA065FAE0B52", "60AE21DCD76CD342BE08BA065FAE0B52",
        "" }
        { "9E296DF3AA15FB4D89CC44D4FA83DB26",
        "60AE21DCD76CD342BE08BA065FAE0B52", "60AE21DCD76CD342BE08BA065FAE0B52",
        "" }
    

    ____________________________________________________

     

    • nr relates to the owned_resource_id from ca_owned_resource
    • cnt relates to the contact_uuid from ca_contact
    • last_mod_by and tenant are optional

     

    Here's an example of a deref file you can use to convert the CI name and contact userid to nr, cnt, and last_mod_by.

    Usage example: pdm_deref -s usp_lrel_cenv_cntref_deref.dat input_file > output_file

     

    usp_lrel_cenv_cntref_deref.dat (contents below)

    ____________________________________________________

    Deref
    {
    input=userid_DEREF
    output=cnt
    rule="select id from ca_contact where userid=? "
    }
    Deref
    {
    input=last_mod_by_DEREF
    output=last_mod_by
    rule="select id from ca_contact where userid=? "
    }
    Deref
    {
    input=ci_name_DEREF
    output=nr
    rule="select own_resource_uuid from ca_owned_resource where resource_name =? "
    }
    

    ____________________________________________________



  • 3.  Re: Import contact to CI

    Former Employee
    Posted 06-08-2016 05:55 PM

    Hi Komgrit - Did Grant's response help answer your question? If so please mark it as Correct Answer. Thanks!



  • 4.  Re: Import contact to CI

    Posted 08-23-2017 11:07 AM

    Hi,

     

    Build a load file based off this example.  Replace CIX with the CI name, useridX with the userid who you want to associate with the CI, and last_mod_by with your userid.  Save this file to a location on an app server.

    1. Create the file usp_lrel_cenv_cntref_deref.dat with the following contents

    TABLE usp_lrel_cenv_cntref 
    ci_name_DEREF userid_DEREF last_mod_by_DEREF tenant


    { "CI1",
    "userid1", "mod_by_userid",
    "" }
    { "CI2",
    "userid2", "mod_by_userid",
    "" }
    { "CI3",
    "userid3", "mod_by_userid",
    "" }
    { "CI4",
    "userid4", "mod_by_userid",
    "" }

    2. Create a spec file to do the conversion and name it usp_lrel_cenv_cntref.spec

    Deref  
    { 
    input=userid_DEREF 
    output=cnt 
    rule="select id from ca_contact where userid=? " 
    } 
    Deref 
    { 
    input=last_mod_by_DEREF 
    output=last_mod_by 
    rule="select id from ca_contact where userid=? " 
    } 
    Deref 
    { 
    input=ci_name_DEREF 
    output=nr 
    rule="select own_resource_uuid from ca_owned_resource where resource_name =? " 
    } 

    3. Put both the dat and spec file in a folder on your app server then navigate to the folder in command prompt.

    4. Run the command, pdm_deref -s usp_lrel_cenv_cntref.spec usp_lrel_cenv_cntref_deref.dat > usp_lrel_cenv_cntref_final.dat (the -s flag specifies the spec file, the next file is the file to dereference, then it outputs the dereferenced data into a new file.)

    5. Review the output in the new usp_lrel_cenv_cntref_final.dat file to ensure it looks right.

    6. Run the command pdm_load -if usp_lrel_cenv_cntref_final.dat to load the data