Hello together,
I tried to set the Story Points field according to a single Select field, to force all users to use the fibonacci values.
Therefor i simply want to copy the value of my Single Select List into the Story Point Field.
As i read, this would be possible with Scriptrunner, so i just installed the trial on a test instance, but failed badly o.O
First attempt was really simple, but woked.. almost 
I tried a behaviour with following code:
def nsp = getFieldByName("New Story Points").getValue();
def sp = getFieldByName("Story Points");
if (nsp != 0) {
sp.setFormValue(nsp);
} else if (nsp == 0) {0} As this would be to easy to be true, it just updates the value in the edit screen, but doesnt update the Issue.
So i tried using a "Script Listener".. therefor i found some suggestions online but none of them worked..
I tried to set a custom listener on Issue Updated and Created with the following code:
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.component.ComponentAccessor
def issue = event.issue as Issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def tgtField = customFieldManager.getCustomFieldObjects(event.issue).find {it.name == "Story Points"}
def calcField = customFieldManager.getCustomFieldObjectByName("New Story Points")
def changeHolder = new DefaultIssueChangeHolder()
tgtField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(tgtField), calcField),changeHolder)
but this just ends in an History hint for the listener "X of X failed, including the last one"
i would appreciate any help..
Thank you