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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Jamie.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This bug is now fixed, please try 2.0.4
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome! Genius! I'm going to try right now!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm using Builtin Script Listener 'Clones an issue and links', and the label isn't being cloned, so I tried to add an 'Additional issue actions' but it didn't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Err.. hrm. I've just reread your question. What I fixed was the fact that the clone issue and create subtask builtin scripts didn't clone the labels. Are you using the built-in script or are you writing your own from scratch? It you're writing your own, I think I may still need to put the event in the binding.. but that's easy, sorry, I just overlooked it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, that should work now in 2.0.4. What I mean is, it should just work by default, without adding any additional script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Works perfect!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
def labels = issue.getLabels()
issue.MutableIssue.setLabels(labels)
--This is the part I'm having trouble
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.