DevOps - JiraCloud Custom Field Option to Custom Field Option Mapping

Originally asked by Support on 08 February 2023 (original question)


Hi, is it possible to map one field with another with different values - similar to how you can map statuses?

I want to map Urgency (JIRA) with Severity (DevOps) in the following way:

"Minor":"1", "Major":"3", "Critical":"5"


Answer by Serhiy Onyshchenko on 10 February 2023

Hey, Support , thanks for raising this on community!
So on Jira incoming the mapping could look like this:

def severityToUrgency = [
  "1" : "Minor",
  "2" : "Minor",
  "3" : "Major",
  "4" : "Critical",
  "5" : "Critical"
]

issue."Urgency" = severityToUrgency[replica."Severity"?.value] ?: issue."Urgency"


And on ADO:

def urgencyToSeverity = [
  "Minor" : 1,
  "Minor" : 2,
  "Major" : 3,
  "Critical" : 4,
  "Critical" : 5
]

workItem."Severity" = urgencyToSeverity[replica."Urgency"?.value] ?: workItem."Severity"

Furthermore, considering that there’s less values on Jira than on ADO I’d also suggest to combine it with the conflict handling approach described here: Avoid updating issue with older changes ADO <> Jira, Jira <> Jira, ServiceNow <> Jira (old community)

Let me know if you have any questions

Regards, Serhiy.


Comments:

Ben Robinson commented on 14 February 2023

Hi Serhiy Onyshchenko , Harold Oconitrillo raised this on my behalf. I am not getting any errors but the information is not being passed between them. Would I have to update the Incoming and Outgoing Syncs of both Jira Cloud and DevOps for this to work?