Maintenance is complete- We've moved from the saas.hpe.com domain to softwaregrp.com click to read more
As part of our journey to complete our separation work and our future integration with Micro Focus, we've now updated our domain for the community. This is an interim step, which will be followed by a series of future update / improvements: - Piloting Idea boards - Refreshing the entire UI. (more to come later) - and more
Quality Center / ALM Practitioners Forum
cancel

Project list item not displaying after database insert

Mark D. William
Regular Contributor.

Project list item not displaying after database insert

I have a project list that I created. I attempted to insert a new item into that database via sql. When performing a query, the record is there but the item is not available in the project list when viewing through QC.

Is there a specific column that needs to be populated or is this not allowed? I have over 900 sub-items that I need to have available in this project list but cannot think of any other way to add them.
15 REPLIES
Venkat457
Outstanding Contributor.

Re: Project list item not displaying after database insert

Mark,

Why don't you try inserting the new item in the QC project itself.Tools-Customize-->project lists-->All projects.

If you are inserting via you will need to find the father ID of the list in ALL_Lists table and then insert it.

Regards,
Venkat
Venkat
Mark D. William
Regular Contributor.

Re: Project list item not displaying after database insert

Hi Venkat,

I do have an initial list already within the QC project. The issue is that I need to add 900+ more items into this list. I could do that manually, but that would take a year, hehe.

I did insert a single list and applied it to the father ID, gave it a new item ID and gave it the next sequential absolute path for its father id. After doing so, the item shows in the database but not in the QC project drop-down list when I attempt to view it.
Venkat457
Outstanding Contributor.

Re: Project list item not displaying after database insert

Mark,

Try using OTA insert,you dont need an year though.

Macro below that does the job,

You basically need to create all items in a single column make sure no column name.While running the macro it will ask you for the file to upload,point this and rest it takes care.listname below is basically your projects list name.

Sub List_Add()

Server = ""
User = InputBox("YourUserName:")
Domain = InputBox("YourDomain:")
Project = InputBox("YourProject:")
ListName = InputBox("YourListName:")
Password = InputBox("Password:")

Set tdc = CreateObject("tdapiole80.tdconnection")
tdc.InitConnection Server, Domain
tdc.ConnectProject Project, User, Password
Set objXL = CreateObject("Excel.Application")
matrisPath = objXL.GetOpenFilename("", 1, "Choose Excel file with list items", "Import", False)

objXL.Visible = False
objXL.Workbooks.Open matrisPath
Set origin = objXL.Cells(1, 1)

Set cust = tdc.Customization
cust.Load
Set listRoot = cust.Lists.List(CStr(ListName)).RootNode
i = 0
Do While 1 = 1
listItem = origin.Offset(i, 0).Text
If listItem = "" Then
Exit Do
End If
'Avoid an error if an item already exists
On Error Resume Next
listRoot.AddChild (listItem)
On Error GoTo 0
i = i + 1
Loop
listRoot.Updated = True
cust.Commit
objXL.Quit
Set listRoot = Nothing
Set origin = Nothing
Set cust = Nothing
tdc.Disconnect
tdc.ReleaseConnection
MsgBox "Finished!"

End Sub
Venkat
Mark D. William
Regular Contributor.

Re: Project list item not displaying after database insert

Thanks Venkat. I will give this a try tomorrow morning.
stonedinaus
Outstanding Contributor.

Re: Project list item not displaying after database insert

900 items in a list! I hate to think of the problem that led to that solution.
Tomi Huttunen
Super Contributor.

Re: Project list item not displaying after database insert

If you still want to pursue the SQL way, although API is more safe, try incrementing the sequences LISTS_VERSION and LIST in SEQUENCES table. Or you can also try adding a single list item in Customize and clicking Save after the others have been added with SQL. This might also bring the SQL-added values visible to the list. You might need to exit from Customize to see them.
Mark D. William
Regular Contributor.

Re: Project list item not displaying after database insert

@Tomi - I never tried it before but yes, saving in that list did display the one I inserted through sql. I will give this api a try in test though.

@stonedinaus - Well, they want all our products and the product features listed and unfortunately, that is over 900 items. I am open to finding an easier way to make this list available for users to select when populating their test plan, hehe.

Thanks all!
stonedinaus
Outstanding Contributor.

Re: Project list item not displaying after database insert

Hi Mark, have you thought about adding extra fields so that you can break it down a bit; e.g product, version, feature, etc. You would need to have a workflow that sets the lists of the dependant fields but it might be quicker/easier to work with.
Mark D. William
Regular Contributor.

Re: Project list item not displaying after database insert

@Vakat - I tried to run what you listed and it goes through and says completed but I am not seeing any results in QC when I review the project list. Nothing in the Immediate Window view in VB Express. Please also note that I am not a VB user, but no obvious user errors thus far.

@stonedinaus - Currently they are in a Parent Child relationship. I have the parents which aren't many and I have the children which are over 900. We could have a Product field and a Feature field. The Feature list would be dependent upon what is selected in the Product field but I still will have to make 900+ overall features available for users to select.

Thanks again for all your help.
Venkat457
Outstanding Contributor.

Re: Project list item not displaying after database insert

Mark,

This is basically an excel macro which uses the standard VB script editor.Did it asked you for pointing an excel file after authentication loop is done.It should ask for the file make sure the values are in the first column with no breaks in between and no column headings.Check your server input parameters are correct.

Once it shows the list import is finished message box,you will need to logout from QC session if logged in to make sure the values gets updated.

Regards,
Venkat
Venkat
Mark D. William
Regular Contributor.

Re: Project list item not displaying after database insert

Venkat,

Sorry for misspelling your name above.

Yes, I am prompted to select the excel file. My values in the excel file are in the first column and no column headings. Would that start the entry on row 2?

Server input is as "http://[:port]/qcbin " which is referenced in the OTA reference.
Mark D. William
Regular Contributor.

Re: Project list item not displaying after database insert

Venkat,

I got the code you gave me to work. I believe the tool I was using to do this wasn't the proper version.

Question, I have my list and my list item. What would I need to do to add a sub-item? Below is an example of the structure:

Feature (this is my list)
----- Item A (this is the root item in my list)
---------- Sub-Item A (The child of my root item)
----- Item B (this is the root item in my list)
---------- Sub-Item A (The child of my root item)
---------- Sub-Item B (The child of my root item)
sssw
Frequent Contributor.

Re: Project list item not displaying after database insert

There is a commercial tool for managing Project Lists available at http://www.qualitycentertools.com/
Tim Mackey
http://www.SilversetSoftware.com
760-729-2358
Shamli
New Member.

Re: Project list item not displaying after database insert

Hi William,

 

I entered the Server name http://qc/qcbin/start_a.jsp , Use Case Name, Password, Domain name an dthe Project name but getting error at tdc.InitConnection Server, Domain line online. It is breaking at thi spoint.

 

COuld you please help me out with this. It is very urgent.

 

 

anuragjalan
Outstanding Contributor.

Re: Project list item not displaying after database insert

enter url upto qcbin/