Confluence has been updated to version 6.15.9

This article shows how to synchronize test cases in HP ALM/QC. 

Introduction

Exalate allows you to synchronize the following entities in HP ALM/QC:

  • Defects
  • Test case (Test Lab module)

You can add sync rules to every entity type separately.  

Check the reference of supported fields and entities that you can synchronize from HP ALM/QC instance.

Configuration

To synchronize multiple entity types, you need to adapt the sync rules using if blocks. This helps Exalate distinguish sync rules for different entity types. Check the examples below: 

Source side

Outgoing sync

To send defects and testCases use the code below  

if(entityType == 'defect') {
replica.key            = defect.key
replica.owner          = defect.owner 
replica.reporter       = defect.detectedBy
replica.summary        = defect.summary
replica.description    = defect.description
replica.comments       = commentHelper.getSingleCommentFromCommentsArea(defect)
replica.status         = defect.status
replica.attachments    = defect.attachments
	///other fields supported by the defect entity

}

if(entityType == 'testCase') {
replica.key            = testCase.key
replica.owner          = testCase.owner 
replica.summary        = testCase.summary
replica.description    = testCase.description
replica.comments       = commentHelper.getSingleCommentFromCommentsArea(testCase)
replica.status         = testCase.status
replica.attachments    = testCase.attachments
	///other fields supported by the test case entity
}

Destination side ServiceNow

You need to map the incoming entities. For example:

  • Jira issue of type bug to the HP ALM/QC defect 
  • Jira issue of type story to the HP ALM/QC test case

Below you can find some examples of mapping multiple issue types from Jira to different entities in the HP ALM/QC.

Incoming sync

If you want to sync multiple entities in one connection, add the following code at the beginning of your Incoming sync rules.

def defaultEntityType = 'defect' //Please change the defaultEntityType to 'testCase' to create test cases by default
if(firstSync) entityType = defaultEntityType else entityType

To create defects with the received information on your side, add the code below.

def defaultEntityType = 'defect' //Please change the defaultEntityType to ‘testCase’ to sync into test cases by default.
if(firstSync) entityType = defaultEntityType else entityType

if(entityType == 'defect') {
    defect.summary      = replica.summary
    defect.severity     = "1-Low"
    defect.description  = replica.description
    defect.attachments  += replica.addedAttachments
    defect.attachments  -= replica.removedAttachments
    defect.commentsArea = commentHelper.mergeCommentsIntoCommentsArea(testCase, replica)
}

To create test cases with the received information on your side, add the code below.

def defaultEntityType = 'testCase' //Please change the defaultEntityType to ‘Defect’ to sync into defects cases by default.
if(firstSync) entityType = defaultEntityType else entityType

if(entityType == 'testCase') {
    testCase.parentId     = qcHelper.getTestPlan("TEST").id
    testCase.typeName     = qcHelper.getTestType("VuGen-Script").id
    testCase.summary      = replica.summary
    testCase.description  = replica.description
    testCase.attachments  += replica.addedAttachments
    testCase.attachments  -= replica.removedAttachments
    testCase.commentsArea = commentHelper.mergeCommentsIntoCommentsArea(testCase, replica)
}


To start the synchronization, create a trigger for every entity type separately.


Have more questions? Ask the community




Back to How to guides