Mapping statuses between JIRA and ADO

Originally asked by Joanna Kwiatek Tokarz on 29 September 2020 (original question)


Hello,

I would like to prepare a mapping between statuses in JIRA and statuses in ADO. Currently, most of the tickets sent from Jira to ADO are in-state New as in Jira we have more statuses than in ADO.

Jira Complex -> Jira Normal -> DevOps Jira Complex <-
New New New New
Planning In Progress Active Planning (No change if: Ready For Development, Development In Progress, Ready For Code Review, Ready For Testing, Testing In Progress)
Ready For Development Active
Development In Progress Active
Ready For Code Review Active
Ready For Testing Active
Testing In Progress Active
Tested Resolved Resolved Tested (No change if: Acceptance In Progress, Accepted, Documented)
Acceptance In Progress Resolved
Accepted Resolved
Documented Resolved
Closed Closed Closed Closed
Reopened Reopened Active Reopened
Removed No Change

Could you please provide me a best way how to do it?


Answer by Francis Martens (Exalate) on 29 September 2020

You can create a map in groovy this way

def workflowMapping = [
       // Rmote issue status -> Local issue status
         "Open" : "Open",
         "Waiting for development" : "In Progress",
         "Action Required" : "Awaiting Feedback",
         "To review" : "Resolved",
         "Closed" : "Closed",
 ]

And then update the ADO state with following set of statements

def targetStatusName = workflowMapping[replica.status.name]
workItem.status = targetStatusName

Of course it could be that either the status is not in the message sent to ADO, or that the mapping doesn’t have the right entry - so to be safe you can fall back to a default by using

def targetStatusName = workflowMapping[replica.status?.name] ?: "Default"
workItem.status = targetStatusName
  • replica.status?.name is using the groovy safety operator and will return null if replica.status is not provided
  • workflowMapping[<expression>] will become null if the index value is null or not found
  • <expression> ?: “Default” will return Default if expression is null

Hope this helps


Comments:

Kunal Ghosh commented on 09 October 2020

Hi Francis,

I would like to thank you for your help. Can you please inform us about the steps for adding those scrips form Azure Devops portal.

Thanking you in advance.

Best Regards,

Kunal Ghosh

Francis Martens (Exalate) commented on 10 October 2020

Well, you have to add these to the connection, which you can find in the exalate console. The exalate console can be accessed through ADO > Organization Settings > Extensions.

The connection is one of the side menu. Find it, and then in the connection list find the appropriate connection to edit

In there you will find the rules editor where you can specify what information can be sent to the other side (outgoing processor) and how incoming messages need to be processed (incoming processor)

The incoming sync is where you would apply this type of configuration

Hope this helps

Francis

PS - Exalate has quite a bit of partners that know how to configure synchronisations.
You might consider engaging with one of them - the list can be consulted on the exalate.com/partners