Note
We've packed up and moved from Confluence to Discourse to bring you a better, more interactive space. Out of courtesy we didn't migrate your user account so - you will have to signup again
The Exalate team will be on holiday for the coming days - returning Jan 4
Enjoy & stay safe
Hi Francis Martens (Exalate), yes, but I also tried to execute the logic after the firstSync and I got the same error.
For completeness, the configuration:
Outgoing sync (source):
replica.key = issue.key
replica.type = issue.type
replica.assignee = issue.assignee
replica.reporter = issue.reporter
replica.summary = issue.summary
replica.description = issue.description
replica.labels = issue.labels
replica.comments = issue.comments
replica.resolution = issue.resolution
replica.status = issue.status
replica.parentId = issue.parentId
replica.priority = issue.priority
replica.attachments = issue.attachments
replica.project = issue.project
replica.environment = issue.environment
replica.customFields."Product" = issue.customFields."Product"
Incoming sync (remote side)
def projectMap = ["Technical DLM/licensing":"DLM","Uniface Anywhere Issue":"UA","Uniface Issue":"UNI"]
if (firstSync) {
// look up project key using the issuetype.name and if not found default to DLM
issue.projectKey = projectMap[replica.type.name] ?: "DLM"
}
issue.summary = replica.summary
issue.description = replica.description
issue.comments = commentHelper.mergeComments(issue, replica)
issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
issue.environment = replica.environment
issue.customFields."Workaround".value = replica.customFields."Product".value?.value
issue.typeName = "Bug"
//if the local issue status is 'New' and the remote issue status is 'Open' use 'Accepted as a bug' transition
if (issue.status.name == "New" && replica.status.name == "Open") {
workflowHelper.transition(issue, "Accepted as a bug")
}
The statement 'if (issue.status ...) is also executed during the first sync.
What you can do is
Note the '?'
This is a groovy operator allowing to test for null - avoiding a nullpointer exception
Meaning -
I've changed the incoming sync to
and the error is gone!
However, when syncing the issue is not transitioned with "Accepted as a bug" to status ACCEPTED
I also tried to move
to the firstsync section, but still no transition.
I'm not sure how to proceed further.
Hi Berry Kersten
Are you sure about the transition name?
(In case the transition doesn't exist or if the proxy user is not permitted the transition, no error will be generated)
I quickly tested a simple script
And this work fine.
An alternative is to enable debug logging and inspect the log files.
Hi Francis Martens (Exalate)Thanks. It's working now.
Main problem: case sensitivity...
Ah yes.
Thanks for confirming.