ALI and Commit Traceability

Commit Template and Commit Pattern

You can enable ALI reporting over your commits by configuring the connector to generate commit messages using a commit template that matches a commit pattern defined on your HPE QC / ALM server.

Global commit templates can be configured by going to Window > Preferences > Mylyn > Team. Project-specific commit templates, which can be shared on your SCM repository, can be configured by right clicking on the project and selecting Properties > Task Repository > Commit Template.

The commit patterns recognized by ALI can be configured on the HPE QC / ALM server under Management > SCM Repositories.

Configuring a Matching Commit Template and Commit Pattern

There are two main options for configuring a matching commit template and commit pattern. If you are using HPE ALI Dev, the commit template in 1) is set by default, so no configuration is required.

1) Configure Connector for Default HPE QC / ALM Configuration

You can use the following commit template, which matches the default HPE QC / ALM commit pattern.

${task.type.lower} #${task.key.numeric}: ${task.description}

Task-Url: ${task.url}

2) Configure HPE QC / ALM for Default Connector Configuration

To configure your HPE QC / ALM server to recognize the connector’s default commit template, go to Management > SCM Repositories and select Commit Pattern > Advanced. Add the following line to the commit pattern. If you are starting from the default commit pattern, this should be added as the 2nd last line, just before the closing ' )'.

| (REGEX('DEF') IDLIST(DEFECT lead='' sep='') | REGEX('REQ') IDLIST(REQ lead='' sep='')) ':' TEXT 

Note that the HPE QC / ALM “Include Default Tasktop Commit Pattern” option recognizes a template which is no longer the default:

${task.status} - task ${task.key}: ${task.description}
Task-Url: ${task.url}

Including Tasks from Other Systems in HPE ALI Reporting

If you use Tasktop Sync to synchronize tasks from HPE QC / ALM to another repository such as JIRA, you can configure Sync to add the ID of each HPE QC / ALM task to the JIRA proxy task by syncing the Task Key ( task.common.key attribute) from HPE QC / ALM to an attribute in JIRA. Then, developers committing against JIRA tasks can include the HPE QC / ALM task ID in their commit messages so that their commits show up in ALI reports.

The HPE QC / ALM task ID can be included in commit messages by using ${task.attribute("PROXY_ID")} in the commit template in place of ${task.key}. Replace PROXY_ID with the label or ID of the JIRA attribute containing the ID of the HPE QC / ALM proxy task. For example, if you are syncing the HPE QC / ALM task ID to a JIRA attribute called hp_proxy and your HPE QC / ALM server has the default commit patterns, use the following commit template:

${task.status} - task ${task.attribute("hp_proxy")}: ${task.description}
Task-Url: ${task.url}

Template Variables (Advanced Use)

You can use template variables to insert other information about the active task or a related task (provided it is in your task list) into your commit messages. When configuring the commit template, press Ctrl+Space to get a list of available template variables with descriptions.

In general, you can use ${task.attribute("X")} to insert the value of the attribute with the label or ID X. Use ${relatedtask.attribute("X", "Y")}, where X is an attribute linking to a related task, to insert the value of the related task’s Y attribute. X can contain the related task’s key or ID (for tasks on the same repository) or its URL (for tasks on any repository). Use ${relatedtask.url("X")}, where X is an attribute linking to a related task on the same repository, to insert the URL of the related task.