I'm trying to clone the labels while it is execute the issue cloning, Is there something missing in this script?
def labels = issue.getLabels()
issue.MutableIssue.setLabels(labels)
There is no method issue.getMutableIssue(). And it looks like you're trying to set labels on itself (issue.setLabels(issue.getLabels)).
Are you have a problem getting a reference to the original issue?
If so it should be in transientVars.get("issue")
so you could try:
issue.labels = transientVars.get("issue").labels
I'm using the groovy script runner plugin. I added a Listener for an event called 'Error from tryouts'.
This is my script for the post-function:
def oldsummary = issue.summary
issue.summary = 'Error - ' + oldsummary
def cf = "customfield_10407"
def fieldname = customFieldManager.getCustomFieldObject(cf)
issue.description = issue.getCustomFieldValue(fieldname)
issue.originalEstimate = 0
--All above this commentary works fine
--This is the part I'm having trouble
Yes, my problem is to get the labels of the original issue. I have tried a lot of alternatives.
issue.labels = transientVars.get("issue").labels isn't working either, it looks like it doesn't recognize the sentence, because the issue isn't being cloned in this case.
I'm looking at the code and I don't see that I'm passing the IssueEvent into the binding for the additional code script, which means this is not going to be possible right now. Having said that, I've been through this before and made it work with the current version of the plugin, but can't find that conversation anywhere now.
I've created a bug, as this should be done without additional code: https://studio.plugins.atlassian.com/browse/GRV-107.
Thanks Jamie.
It looks like you're new here. Sign in or register to get started.