Ignoring statuses in the status map

Originally asked by Howard Kenny on 21 November 2020 (original question)


Hi,

How can you ignore/exclude a specific status from the statusMapping? We have Azure DevOps statuses that don’t need to sync back to a status in Jira. And because statuses can be changed in Azure DevOps without following a workflow (unlike Jira), it’s impossible to assume a Jira status to map it to (eg. state of ‘Further Information’ could be chosen at any point).

Cheers!


Answer by Juan Grases on 21 November 2020

You would do this:

//Incoming:
def statusMap = [
            "Done": "Resolved",
            "In Progress": "In Action"
]
def localStatus = statusMap[replica.status.name]
if(localStatus){
  issue.setStatus(localStatus)
}

This would only apply statuses that are on the mapping.


Comments:

Howard Kenny commented on 21 November 2020

Cheers Juan

Stephen Sayler commented on 10 August 2021

Would this also work for resolutions? e.g.

//Incoming: 
def resolutionMap = [
            "Done": "Done",
            "Won't Do": "Canceled"
            "Duplicate": "Canceled"
            "Cannot Reproduce": "Canceled"
            "Incomplete": "Canceled"
]
def localResolution = resolutionMap[replica.resolution.name]
if(localResolution){
  issue.setResolution(localResolution)
}

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.