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  ?

 

Parents Reply Children
  • 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

     

  • 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 

  • 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.

  • Hi ALARMus ,

    i did it using FC and i could combine 3 values (fields) toghether thank you.

    and my issue now that i cant update the CM with the version value .

    could you help me please how i can pass this value to device table ?

  • Describe more details what you have now (table, field, value) ?

    What condition when you whant to start transfer some data to what table and what field ?

    =============

    KUDOS are Welcome

  • Hi ALARMus,

    i want to transfer a customized field in "cm3r" table named as "releaseversion " when i close the change record of category "Release Management " to the  "version' field in the "Device" Table .

    i want a query which always update the version value from the release record for this CI

    source                         Destination 

    release version            version

    cm3r                             device

    condition : cm3r status is closed 

     

  • what name of field in cm3r table wich contain value of logical.name for table device ?

  • Trigger for cm3r table  (after update), name it like cm3r.a.u.Add2Device

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

    That's mean if the change status is changed and equel "Closed"

    Then update Device table with data from cm3r table.

  • Hi ALARMus  ,

    it gives me this error:

    Script <no name>  line 1: ERROR SyntaxError: invalid assignment left-hand side at char 76

    if (!system.functions.same(record.status,oldrecord.status) && record.status="Closed")

                                                                               ^

    Compilation of JavaScript function or expression failed