Hey,
I need to copy value form last comment to my custom field (Simple multiline text field).
Below is my code, but it doesn't work. Part about last comment is okay. I think that setting value is wrong, any ideas why? I can't see any errors...
import com.atlassian.jira.component.ComponentAccessor
String lastcomment = ""
def comments = ComponentAccessor.commentManager.getComments(issue)
if (comments) {
lastcomment = comments.last().body
}
def changeCf = customFieldManager.getCustomFieldObjectByName("MyCustolField1")
issue.setCustomFieldValue(changeCf, lastcomment)