Update CI version Automatically

 

I want to update the CI version automatically when we close a release record 

the naming convention will be like displayName_Location_Date, this will be from cm3r table to device file .

 

any help to do this  ?

 

Top Replies

Parents
  • 0  

    Release record is change record (cm3r) - Right ?

    The new value must be inserted into device table, in what field ?

    Then you need to use triggers for cm3r table (after change)

    set condition for status and if it become close (or any you use) set in device table any changes you whant.

  • 0   in reply to ALARMus

    hi  ALARMus,

     yes it is cm3r record.

    we want the version field to be sum of (CIName_CIType_Vx 1)

    how we can collect all this one field ?

  • 0   in reply to Nadeen

    CIName_CIType_Vx 1 - is this fields from device table ?

    Can you write exact name of field and table name (where this field is) ?

  • 0   in reply to Nadeen

    CIName_CIType_Vx 1 - is this fields from device table ?

    Can you write exact name of field and table name (where this field is) ?

  • 0   in reply to Nadeen

    CIName_CIType_Vx 1 - is this fields from device table ?

    Can you write exact name of field and table name (where this field is) ?

  • 0   in reply to ALARMus

    No its not a filed  they are 3 fields !

    but when we update the version of a CI the new version (version field in device table ) should contain those 3 three information .

    my question is : how we can gather three fields in one field as a text ?

  • 0   in reply to Nadeen

    So. You can use FC and script (as trigger)

    FC:

    In Calculations for calculation line:

    Use field of table or temporary variable (for example - $L.Version)

    $L.Version="Some text if need - " field1 in $file ", Some more fixed text if need; " field2 in $file

    Well now just transfer this $L.Version where you need.

    *****************

    Or You can use Triggers :

    if (!system.functions.same(record.status,oldrecord.status) && record.status=="Closed")
    {
    	var TableDevice = new SCFile("device");
    	if (TableDevice.doSelect("logical.name=\"" record.number "\"") == RC_SUCCESS)
           {
            TableDevice.version= record.YOURFIELD1 "_" record.YOURFIELD2 "_" record.YOURFIELD3
           }
    }

    If this trigger for CM3R table so - record.YOURFIELD1 - field from cm3r table and

    record.number field in CM3R table wich contained logical.name value

     

  • 0   in reply to ALARMus

    thank you very much ALARMus this will help me a big deal!

    im trying to add this trigger on cm3r table.

    could you please help me to choose the appropriate application for this trigger ? I'm attaching a screen shot 

Reply Children
  • 0   in reply to Nadeen

    See my previous post (i fixed some script line)

    What do you mean "appropriate application for this trigger" ?

    If this is for change then cm3r. Fix your new script in trigger.

    And dont forget to compile it.