HP Quality Center field names

前端 未结 2 770
面向向阳花
面向向阳花 2020-12-22 09:51

I am interacting with HP QC using python and referring to HP ALM OTA documentation. What I need is to access fields in different places (particularly now I am trying to acce

相关标签:
2条回答
  • 2020-12-22 10:04

    I think, the field you are looking for is CY_COMMENT (hint). Maybe there is a better way—but you can find the names of the fields in the Query Builder. If you create an Excel Report and open the Query Builder, there is an Entities View which shows all the fields of the tables (even the user-defined fields). Maybe there is some kind of database documentation which gives you the same thing.

    0 讨论(0)
  • 2020-12-22 10:18

    When you get an entity field value, the field must be the underlying database column name for that entity. You can discover this using the project customization UI in HP ALM: select project entities then explore the system or user fields. Beware that the Design Step says the column name begins ST_... it doesn't. It's actually DS_...

    You can also get this information programmatically. Given a factory instance use the equivalent of:

    private void ExploreFactoryFieldDefinitions(IBaseFactory factory)
        {
            List fields = factory.Fields;
    
            foreach (TDField field in fields)
            {
                FieldProperty field_property = (FieldProperty)field.Property;
    
                if (field_property.IsRequired)
                {
                    Log(String.Format("User Label: {0}\n", field_property.UserLabel));
                    Log(String.Format("User Column Type: {0}\n", field_property.UserColumnType));
                    Log(String.Format("DB Column Name: {0}\n", field_property.DBColumnName));
                    Log(String.Format("DB Column Type: {0}\n", field_property.DBColumnType));
                    Log(String.Format("DB Table Name: {0}\n", field_property.DBTableName));
                }
            }
        }
    

    field_property.UserLabel gives you the user friendly field name. field_property.DBColumn name gives you the database column name that should be used with entity[field_name].

    BTW - don't forget to call entity.Post() to have your changes saved. When working with a versioned project you have a few more hoops to jump through too. Good luck!

    0 讨论(0)
提交回复
热议问题