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.
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.
Based on your experience… any simple code?
Thanks for your comments.
Enviado el: viernes, 9 de junio de 2017 12:37
Para: John Vásquez <firstname.lastname@example.org>
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>
I will try to find something and get back to you.
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.
,10000000 as 'ATTRIBUTETYPEID'
,null as 'VALUE'
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.
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?
Owner Type = I means the attribute is from an item, not item history.
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
,<new item attribute id> as 'ATTRIBUTETYPEID'
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.