DevOps work item import for Azure Boards

  • Release version: Washingtondc
  • Updated August 1, 2024
  • 1 minute to read
  • Azure Boards work items are mapped to default ServiceNow DevOps states and types during import. You can use the DevOpsAzureDevOpsWorkItemHelper script include to customize the mappings.

    Default Azure Boards work item mapping

    Native State and Native Type fields of the work item contain the original state and type values from the source tool.

    Table 1. Work item type mapping
    ServiceNow DevOps Azure Boards Basic Azure Boards Agile Azure Boards Scrum
    Task Task

    Task

    Test case

    Task

    Impediment

    Test case

    Bug Issue

    Bug

    Issue

    Bug
    Story -- User story Product backlog item
    Epic Epic Epic Epic
    Feature -- Feature Feature
    Note:
    Historical import of Azure DevOps work items is not supported for Agile Boards CMMI process.
    Table 2. Work item state mapping
    ServiceNow DevOps Azure Boards Basic Azure Boards Agile Azure Boards Scrum
    Planned To Do New

    New

    Open

    Approved

    Committed

    To do

    WIP Doing

    Active

    Design

    In Progress

    Design

    Complete Done

    Ready

    Closed

    Done

    Ready

    Closed

    Deleted Deleted

    Completed

    Deleted

    Removed
    Note:
    When an imported Azure Boards work item type or state is not recognized, the value is set to Other.

    Customize Azure Boards state and type mappings

    Access the DevOpsAzureDevOpsWorkItemHelper script include in the System Definition > Script Includes module.

    This script example adds new states and types for custom processes MyScrum and CustomBasic. CustomBasic inherits the state and type defined for Basic process.

    var DevOpsAzureDevOpsWorkItemHelper = Class.create();
    
    DevOpsAzureDevOpsWorkItemHelper.prototype = Object.extendsObject(DevOpsAzureDevOpsWorkItemHelperSNC, {
    	
    	setDefaultProcess: function (projectProcess){
    		
    		DevOpsAzureDevOpsWorkItemHelperSNC.prototype.setDefaultProcess.call(this, projectProcess);
    		
    		//set custom states and types
    		var newStates, newWITypes;
    		if (projectProcess == 'NPScrum'){
    			// no parent process set. So type and states avaibale will be linited to newStates
    			// and newWITypes
    			newStates = {
    				'Delayed': 'planned',
    				'Approved': 'wip'
    			};
    			newWITypes= {
    				'Request': 'story',
    				'Incident': 'task'
    			};
    			
    		} else  if (projectProcess == 'CustomBasic'){
    			//set parent process to Basic to inherit basic states and types
    			this.setParentProcess('Basic');
    			newStates = {
    				'Auto-Approved': 'wip'
    			};
    			newWITypes= {
    				'UserStory': 'story'
    			};
    		}
    		
    		this.setStates(newStates);
            this.setWorkItemTypes(newWITypes);
    	},
    	
    	type: 'DevOpsAzureDevOpsWorkItemHelper'
    });