I am getting this error in the sync attempt while trying to sync the Epic Status value:
Field Specify a valid ‘id’ or ‘name’ for Epic Status: customfield_10012.
This is my setting on the incoming script - as you can see, I’m setting it to a specific value:
issue.customFields.“Epic Status”.value = “To Do”
Jira Server Outgoing:
replica.customFields."Epic Status" = issue.customFields."10003" //Epic Status (gh-epic-label)
Jira Cloud Incoming:
def epicstatusMap = ["10000":"10016", "10001":"10017", "10002":"10018"] //To Do In Progress, Done
def epicstatusIncomingID = replica.customFields."Epic Status".value.value
/*
def epicstatusId = epicstatusMap[epicstatusIncomingID]
if (epicstatusId == null) {
throw new com.exalate.api.exception.IssueTrackerException("No Epic Status mapping for incoming Epic Status value(s) " + epicstatusIncomingID)
}
*/
issue.customFields."Epic Status".value = "To Do"
When I do that, I get the error initially reported.
So, I have adjusted the sync config as follows:
if (issuetype == "bug") {
... update bug specific fields
Epic.receive()
} else if (issuetype == "epic") {
... update epic specific fields
def epicStatusValue = replica.customFields."Epic Status".value.value
issue.customFields."Epic Status".value = nodeHelper.getOption(issue, "Epic Status", epicStatusValue)
} else if (issuetype == "story") {
... update story specific fields
Epic.receive()
} else if (issuetype == "task") {
... update task specific fields
Epic.receive()
}
Notice the Epic.receive() code is at the end of the incoming sync (per the documention), but it is now inside all code sections EXCEPT the epic section, instead of at the end of all code.
So far, this seems to work.
I’ll update it as I see more or less success.
Comments:
Francis Martens (Exalate) commented on 26 August 2021
Ah - thanks for the hint. We’re reviewing the external script and will take this into account