Creating work items with Git commit messages

You can create a work item and link a Git commit to the work item. A work item is created only in the context of the process area to which the Git repository is registered. The permissions that are required for linking work items are also required for this feature. Also, you must have permissions to create a work item and to modify all of the work item attributes that are specified in the commit message. If GitHub webhooks are configured to use functional users and the work item is created using a functional user, then the functional user must have the appropriate role and permissions.

You can create a work item from a Git commit message that contains the keyword #create. For example:

git commit –a –m “fix some issue #create *defect ^\”JKE Banking Project Area\” @:Bob $Medium !High #tag1 summary of the work item”

The following table defines symbols for work item attributes.

Symbol Attribute

*

Type The work item type. Either task or defect.

^

Filed Against The project area name or project area ID. Use an internal ID because project area names can be repeated.

>

Found In The release in which the defect or task originated.

@:

Owned By The userId.

$

Priority

!

Severity

#

Tags You can specify multiple tags as a comma-separated list. For example, #tag1,tag2

To specify custom attributes, use id:value, where id is the work item attribute internal ID. For example:

git commit –a –m “fix some issue #create *defect ^\”JKE Banking Project Area\” @:Bob $Medium !High #tag1 customAttributeId:20 summary of the work item”

Specify multi-valued attributes as a comma-separated list.

The text that follows the work item attribute is a summary of the work item.

Use quotation mark escape characters for any string that includes spaces. For example, \”JKE Banking Project Area\”

Supported attributes

The following attributes are supported.

  • Boolean true or false

  • Category

  • Complexity

  • Complexity (Enumeration List)

  • Contributor The IBM® Engineering Workflow Management (EWM) user ID.

  • Contributor list The EWM user ID.

  • Decimal

  • Deliverable The releases that are defined for the project area.

  • Duration The time, in week/day/hour/minute format. For example, 4w2d6h

  • Integer

  • Iteration

  • Long

  • Priority

  • Priority (Enumeration List)

  • Project Area

  • Severity

  • Severity (Enumeration List)

  • Small String

  • String

  • String list

  • Timestamp Format is MMM dd, yyyy, hh:mm:ss a.

Defining an alias for a work item internal ID

You can define an alias in the Git remote repository to a work item internal attribute by setting it as a Git configuration. Run the following command in the Git remote repository to set the alias.

git config rtcwi.internal_id.alias alias

The internal_id of the attribute APAR is com.ibm.rtc.workitem.apar. To define an alias apar for this ID, run the following command from the Git remote repository directory:

git config rtcwi.com.ibm.rtc.workitem.apar.alias apar

The Git commit message results in the following:

git commit –a –m “fix some issue #create *defect ^\”JKE Banking Project Area\” @:Bob $Medium !High #tag1 apar:20 summary of the work item”