Topic adding a listener that clones an issue:
I have a customfield called 'Detected Error' and I want that in Additional Issue Actions the description of the cloned issue to store the value of this customfield.
I've done a lot of tests but I can't figue it out.
For example it isn't working this way:
def cf = "customfield_10407"
def fieldname = customFieldManager.getCustomFieldObjects(cf)
issue.description = issue.getCustomFieldValue(fieldname)
You should be able to do:
issue.description = cfValues["Name of custom field"]
Use the name of the CF, not the ID. It should work from memory, but not tested... LMK.
BTW your way should work but you need getCustomFieldObject not getCustomFieldObjects. The plural form returns a list.
I can't believe that 'S' was my problem! I wasted almost a complete day with this! Now is working!...
Thanks Jamie!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah... it happens ;-) Try to get into the habit of using some log.debug statements and change your log level, then you can see easily what's getting returned.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jamie, from where I can take the field values? For example, when the issue is cloned, the timeestimated should not be cloned. So, It should be like:
issue.timeOriginalEstimate = ''
issue.timeoriginalEstimate = ''
issue.timeoriginalestimate = ''
Are this names related to the column names in database?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
issue.originalEstimate = 0 // IIRC
They may be related to the column names but the javadoc is the place to look. Also you should probably start a new question for this, not many people will look at answered questions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Jamie, I'll trasspass this to a new question.
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.