Application Lifecycle Conductor

 View Only
  • 1.  Make new attribute available to previous items

    Posted Jun 08, 2017 06:05 PM

    We have created a new date attribute for projects item types, and publish it using the screen definition. But, this new attribute is only available for new projects and not for the previous ones.

     

    There is any precedure to make this field available to previous project items?

     

    Thanks for your help.

     

    Regards,

    JOHN



  • 2.  Re: Make new attribute available to previous items

    Broadcom Employee
    Posted Jun 09, 2017 01:36 PM

    Hi John, There is no out of the box way to do this. We need to write some sql to go over the project items in the database and update those.



  • 3.  Re: Make new attribute available to previous items

    Posted Jun 09, 2017 01:39 PM

    Based on your experience… any simple code?

    Thanks for your comments.

    Regards,

    JOHN

     

    De: garma20

    Enviado el: viernes, 9 de junio de 2017 12:37

    Para: John Vásquez <johnv@it-synergy.net>

    Asunto: Re:  - Re: Make new attribute available to previous items

     

    CA Communities <https://communities.ca.com/?et=watches.email.thread>

     

     

    Re: Make new attribute available to previous items

     

    reply from Madhu Garimilla<https://communities.ca.com/people/garma20?et=watches.email.thread> in CA Application Lifecycle Conductor - View the full discussion<https://communities.ca.com/message/241985219-re-make-new-attribute-available-to-previous-items?commentID=241985219&et=watches.email.thread#comment-241985219>



  • 4.  Re: Make new attribute available to previous items

    Broadcom Employee
    Posted Jun 09, 2017 01:42 PM

    I will try to find something and get back to you.



  • 5.  Re: Make new attribute available to previous items

    Broadcom Employee
    Posted Jun 14, 2017 10:04 AM

    Hi John, Here is the query you can use to add attributes to the old project items.

     

    WARNING: Make sure to take a backup of your database before executing this query.

     

    Some details on Highlighted values which you need to replace it with the ones you have in your ALC instance.

    1. 10000000 - You need to replace this with the id of new date attribute that is added to the project item type. You can find this by opening project item type in detail view in Admin perspective and navigate to the Attribute Types tab in detail view.
    2. 1000 - You need to replace this with the id of the another existing attribute type of the project item type.

     

    QUERY:

     

    SELECT [OWNERID]

          ,[OWNERTYPE]

          ,10000000 as 'ATTRIBUTETYPEID'

          ,null as 'VALUE'

          ,[CREATEDBY]

          ,[CREATEDON]

          ,[MODIFIEDBY]

          ,[MODIFIEDON]

    FROM [ITEM_ATTRIBUTE] WHERE [ATTRIBUTETYPEID] = 1000 AND [OWNERTYPE] = 'I' AND [OWNERID] NOT IN (SELECT [OWNERID] FROM [ITEM_ATTRIBUTE] WHERE [ATTRIBUTETYPEID] = 10000000)

     

     

    Let me know if you see any issues or need more information.



  • 6.  Re: Make new attribute available to previous items

    Posted Aug 14, 2017 06:57 PM

    Hi, thanks for your response.

     

    So, your suggestion is to use this query in order to make an update from database interface?

     Another question based on this query, the OWNERTYPE="I" What does that field refer to?

     

    Thanks for your help.

    Regards,

    JOHN



  • 7.  Re: Make new attribute available to previous items

    Broadcom Employee
    Posted Nov 07, 2017 07:08 PM

    Owner Type = I means the attribute is from an item, not item history.



  • 8.  Re: Make new attribute available to previous items

    Posted Nov 16, 2017 09:23 AM

    Thanks you all for your support in this.

     

    Finally we use this sentence in order to allow fill a new attribute value to old items.

     

    INSERT INTO ITEM_ATTRIBUTE

    SELECT [OWNERID]

          ,[OWNERTYPE]

          ,<new item attribute id> as 'ATTRIBUTETYPEID'

          ,null as 'VALUE'

          ,[CREATEDBY]

          ,[CREATEDON]

          ,[MODIFIEDBY]

          ,[MODIFIEDON]

    FROM [ITEM_ATTRIBUTE] WHERE [ATTRIBUTETYPEID] = <existing attribute type id> AND [OWNERTYPE] = 'I' AND [OWNERID] NOT IN (SELECT [OWNERID] FROM [ITEM_ATTRIBUTE] WHERE [ATTRIBUTETYPEID] = <new item attribute id>)

     

    Where "<new item attribute type>" is the ID of the new attribute that has been added

    And "<existing attribute type id>" is the ID of an attribute type that existed before for this item type

     

    Do not forget to backup your database.

     

    *Special mention to Melinda Skelton.

     

    Best Regards,

    John