How to Sync HP ALM/QC Custom Fields

    Warning: We are moving Exalate for HP QC/ALM into basic maintenance mode. This transition period will last until November 2024, after which support will be halted completely. For more information, please see https://exalate.com/blog/end-of-support-hp/.

    You can synchronize custom fields between HP QC/ALM and JIRA Instances. In HP QC/ALM custom fields are called user fields. You should use the Physical name of the user field in the sync rules.  To get the physical name of a field in HP ALM use this URL:

    [your HP ALM instance URL]/qcbin/rest/domains/DEFAULT/projects/GREY/customization/entities/defect/fields
    Available types of user fields in HP QC/ALM defect Available types of custom fields in HP QC/ALM test cases
    • String
    • Multi-line text field
    • Number field
    • Date
    • User List
    • Lookup list (multiple values support)
    • String
    • Number field
    • Date
    • User List
    • Lookup list (multiple values support)

    There are always two main configuration points: a source side that sends data and a destination side that receives data.

    Source Side

    The sending side needs to add the custom field to the replica in the  Outgoing sync.

    HP QC/ALM

    Outgoing sync

    Defect custom field

    //BG_USER_02 is a defect custom field name
    replica.customFields."BG_USER_02" = defect.customFields."BG_USER_02"

    Test case custom field

    //TS_USER_05 is a test case custom field name
    replica.customFields."TS_USER_05" = testCase.customFields."TS_USER_05"

    JIRA

    Add the code to the Outgoing sync to send the issue custom field value to the HP QC/ALM Instance.

    replica.customFields."custom field name" = issue.customFields."custom field name"

    Note: You must use the correct custom field name to get the defect/testCase custom field value.

    Destination Side

    Incoming sync

    JIRA

    For simple field types like text custom field, you can just assign the value of the received custom field to the local one. The replica.customFields is set by the remote Instance. The issue.customFields is the custom field in Jira. This is an example of how to assign the value of the received HP QC/ALM custom field to the local JIRA custom field.

    issue.customFields."Local Custom field name".value = replica.customFields."BG_USER_02"

    Multi-select custom field type

    Set the values received from the HP QC/ALM multi-select custom field to the Jira multi-select custom field options.

    issue.customFields."Local Custom field name".value = replica.customFields."BG_USER_04"?.value?.collect { opt -> opt?.value }

    HP QC/ALM

    The replica.customFields  is set by the Jira Instance. The defect.customFields and testCase.CustomFields are the custom fields in HP QC/ALM defects and test cases. This is an example of how to assign the value of the received Jira custom field to the local HP QC/ALM custom field.

    Defect

    //add value from the jira custom field into the defect custom field with name BG_USER_02
    defect.customFields."BG_USER_02".value = replica.customFields."jira custom field name".value

    Test case

    //add value from the jira custom field into the test case custom field with name TS_USER_05
    testCase.customFields."TS_USER_05".value = replica.customFields."jira custom field name".value