Originally asked by Jeff Roncone on 14 April 2023 (original question)
I do not want my ADO areapath changed at all on sync from ZD to ADO. I am ONLY SYNCING a ZD ticket to an EXISTING ADO ticket. I know that it is required, I have tried 2 different methods.
METHOD 1 :
I have tried to pull the areapath from a URL call to ADO and it is not working ( ADO incoming script )
def remoteKey = replica.customFields."key"?.value
if(remoteKey){
boolean correct = false;
def localWorkItem = httpClient.get("/_apis/wit/workitems/${remoteKey}?api-version=7.0", correct)
//debug.error("${localWorkItem}")
//if(localIssue == null) throw new com.exalate.api.exception.IssueTrackerException("Issue with key "+remoteKey+" was not found")
workItem.key = localWorkItem?.id
workItem.id = localWorkItem?.id
workItem.Project = localWorkItem?.Project
workItem.areaPath = localWorkItem?.AreaPath
//debug.error("${localWorkItem?.areaPath}")
return;
}
METHOD 2 (not my preferred way)
I am trying to map a custom drop down field in Zendesk to the areapath in AZDO. ADO Incoming Script
def areaPathMap = [
"compas_ex" : "Test-Sandbox\\compas",
"bold_incidents" : "Test-Sandbox\\WOW Backlog",
"test_me_aap" : "Test-Sandbox\\Bold_Intergrations_tst",
]
def targetareaPath = areaPathMap[replica.customFields."Azdo Area Path"?.value] ?: "compas_ex"
workItem.areaPath = targetareaPath