Hi
i have a transition with a customfield ( type : Hideable Free Text Field )
and the system field "Comment", set by default on my transition screen.
what i want to do is to copy the value of the comment into the customfield ( it will be hiden) on a postfonction custom script with script runner.
the customfield is also configured on the edit screen of the issue type i'm working on.
after searching, i came up with this code :
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.component.ComponentAccessor
MutableIssue issue = (MutableIssue) issue;
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def tgtField = customFieldManager.getCustomFieldObjects(issue).find {it.name == "test_Commentaire_client"}
def changeHolder = new DefaultIssueChangeHolder()
tgtField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(tgtField),transientVars.comment as string),changeHolder)
I do not have any errors on my logs , but the customfield is never updated after calling my transition.
Can you help me ?