SI am wondering if you have any Sync Rule resources that you can point me towards to help navigate this configuration issue in the Sync Rules.
We have a customized Bug form in Azure DevOps that has two required fields (âProduct Version" and âFound In Versionâ). In Azure DevOps the acceptable entries for these fields are controlled by GlobalLists. So they may not be recognized as text strings as I initially thought that they would.
The Jira side is not reporting any errors or problems. The Jira work item (Bug type) has a Sync Status of âWaiting for Remoteâ.
Below is a sample error message on the ADO side of the connection:
Error Detail Message:
Bad response when creating work item - 400 - response body: TF401320: Rule Error for field Product Version. Error code: Required, HasValues, LimitedToValues, InvalidEmpty. One additional error occurred during validation of the work item. Please correct all errors and try again.
Work item sync flow is from Jira to ADO.
Here are the Incoming Sync rules on the ADO side:
if(firstSync){
// Set type name from source entity, if not found set a default
workItem.typeName = nodeHelper.getIssueType(replica.type?.name)?.name ?: "Task";
}
workItem.summary = replica.summary
workItem.description = replica.description
workItem.priority = replica.priority
workItem.labels = replica.labels
workItem.attachments = attachmentHelper.mergeAttachments(workItem, replica)
workItem.comments = commentHelper.mergeComments(workItem, replica)
//Set Custom Fields for Bugs, this is not working
workItem.customFields."Product Version" ="Nexus"
workItem.customFields."Found In Version" = "7.4.1.0"
Resolution required reviewing the JSON fields for the impacted work Item type (the Bug Type in this case) to determine the correct field name that ADO was using.
To view the JSON details for an ADO Work Item, edit a work item in a web browser.
Copy and paste the URL to a text editor.
Replacing /_workitems/edit/ in the URL path with /_apis/wit/workItems/
to work. Are you sure you are getting a value from replica.customFields."Order Number" ? You can use the âEntity sync statusâ menu to check the remote replica (incoming replica) for the work item you are syncing.
Howard Kenny commented on 21 November 2020
And you would be right! Iâd put it in the âcreateâ section, but not the âchangeâ section (which is how I was testing it) - my mistake.