---
sourceDocument: Brazil IT Service Management
sourceDocumentLink: https://www.servicenow.com/docs/r/it-service-management

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil IT Service Management

ft:clusterId :

    - itsm

bundleId :

    - itsm

workflow :

    - Technology


---

# Associating multiple work items to a commit in DevOps

# Associating multiple work items to a commit in DevOps {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Associating multiple work items to a commit in DevOps

ServiceNow DevOps supports associating multiple work items with a single commit across popular DevOps platforms such as Azure DevOps, Bitbucket, GitHub, and GitLab.
This capability enables traceability between code changes and relevant work items, improving visibility into development progress and impact.
Show full answer Show less  

## Key Features

* **Multiple Work Item Support:** Commit messages can reference multiple work items using various syntax patterns, allowing comprehensive tracking.
* **Out-of-the-Box Commit Message Formats:** Default supported formats include:
  * **Colon pattern:** e.g., "STRY1,STRY2: Additional fixes"
  * **Hash pattern:** e.g., "Fixes for #STRY1, #STRY2"
  * **Jira pattern:** e.g., "JRA-123 fixed"
* **Customizable Parsing Logic:** Customers can extend the `DevopsCommitMessageParserSNC` script include to add support for organization-specific commit message formats by implementing custom regular expressions and parsing logic.
* **Example Extension Provided:** Demonstrates how to parse custom formats such as work item IDs enclosed in square brackets (e.g., "\[STRY1\], \[STRY2\] Additional bug fixes") by overriding methods in the `DevopsCommitMessageParser` class.
* **Linking in UI:** Work items can also be linked manually via the Azure DevOps user interface. Associated work items are visible in the DevOps Commit record and in the Pipeline UI within ServiceNow.

## Practical Benefits for ServiceNow Customers

* Enables accurate and flexible linking of multiple work items to commits, reflecting real development workflows.
* Improves traceability and reporting by ensuring commits are correctly associated with all relevant work items.
* Supports customization to align with unique organizational commit message conventions without codebase changes.
* Provides visibility into commit-work item relationships directly within ServiceNow DevOps dashboards and interfaces.  
Multiple work items for a commit are supported in DevOps for Azure DevOps, Bitbucket, GitHub, and GitLab.

Work item syntax in the commit message can be customized to reflect the processes in your organization using the DevopsCommitMessageParserSNC script include in the System Definition \> Script Includes module.  
In order to link the commits with work items, the work item native ID is extracted from the commit message. In the base system, DevOps supports following commit message formats:

    /**
         * Supported patterns
         * Colon pattern 
             * Sample supported formats: 
                 *   1. STRY1,STRY2: Additional bug fixes
                 *   2. STRY1 , STRY2 : Additional bug fixes
                 *   3. STRY1, STRY2 : Additional bug fixes
         * Hash pattern 
             * Sample supported formats: 
                 *   1. Fixes for #STRY1, #STRY2, #STRY3
                 *   2. Fixes @$#3 and #1 work item
                 *   3. Fixes for #STRY1 #STRY2 #STRY3
                 *   4. Fixes for AB#123
         * Jira pattern
             * Sample supported formats: 
                 *   1. JRA-123 fixed
                 *   2. JRA-123 JRA-234 JRA-345 resolved
         */

If you want to add support for additional message formats to meet the processes in your organization, you can add a custom logic in the DevopsCommitMessageParser script include by navigating to the System Definition \> Script Includes module. DevopsCommitMessageParser script include extends from DevopsCommitMessageParserSNC. The DevopsCommitMessageParserSNC has three regular expressions defined for identifying work item native IDs for supported message formats in the base system. See the following example to include a new custom message format that has work item native IDs in square brackets.

    var DevopsCommitMessageParser = Class.create();
    DevopsCommitMessageParser.prototype = Object.extendsObject(DevopsCommitMessageParserSNC, {
        initialize: function() {
            DevopsCommitMessageParserSNC.prototype.initialize.call(this);
            this._customPattern = /\[(.*?)\]/g; // The regex pattern to match the words written inside square brackets.
            // Example commits message to match this custom pattern is : "[STRY1], [STRY2] Additional bug fixes"
        },
        getWorkitemsFromCommitMessage: function(message, branchName) {
            var workitems = [];
            // We first call the getWorkitemsFromCommitMessage method from the parent class to get the matching workitems ids for OOB formats
            var defaultWI = DevopsCommitMessageParserSNC.prototype.getWorkitemsFromCommitMessage.call(this, message, branchName);
            if (!gs.nil(defaultWI) && defaultWI.length > 0) {
                workitems = workitems.concat(defaultWI);
            }
            // Now call your custom method that returns an array of workitem native IDs matching custom pattern
            var customWI = this.getWIFromCustomPattern(message);
            if (!gs.nil(customWI) && customWI.length > 0) {
                workitems = workitems.concat(customWI);
            }
            // getUniqueWorkItems method from parent class removes duplicates from the workitems array
            workitems = this.getUniqueWorkItems(workitems);
            // return the final list
            return workitems;
        },
        getWIFromCustomPattern: function(message) {
            var wi = [];
            var l;
            var match;
            var matches = message.match(this._customPattern);
            if (gs.nil(matches))
                return wi;
            for (var i = 0; i < matches.length; i++) {
                l = matches[i].length;
                match = matches[i].substring(1, l - 1); // trim the brackets
                wi.push(match);
            }
            return wi;
        },
        type: 'DevopsCommitMessageParser'
    });

Linking work items to a commit using the Azure DevOps user interface is also supported in DevOps.

You can view the list of associated work items in the DevOps Commit record, and in the Pipeline UI.

