Hi there,
I have a numerical custom field, and I'm trying to increment its value through a workflow post function using the Script Runner plugin.
I know this has been asked and answered numerous times before, but I have yet to find a piece of code that actually works. I know very little about Groovy, so I've basically resorted to copy and paste.
This is what I currently have, which does nothing at all:
def tgtField = customFieldManager.getCustomFieldObjects(issue).find {it.name == "Iterations"} // <-- that's what the field is called
def changeHolder = new DefaultIssueChangeHolder();
tgtField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(tgtField), issue.getCustomFieldValue(tgtField) + 1),changeHolder);What am I doing wrong, and more importantly, what should I do instead? Any help is greatly appreciated.