Hi,
we would like to set a custom field value on an event. At the moment, we already have a script listener sending out email notifications. Can we add setting the field to this listener?
And: If we can, please give a hint on how to set it.
Below Groovy example is to set text Custom Field
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.issue.util.DefaultIssueChangeHolder import com.atlassian.jira.issue.ModifiedValue def customFieldManager = ComponentAccessor.getCustomFieldManager(); def cf1 = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'cf1Name'}; def changeHolder = new DefaultIssueChangeHolder(); cf1.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(cf1), 'newCf1Value'), changeHolder); issue.store();
Does Groovy script do this only after user Submits the form?
Is there any event fired right after a field is modified (new option selected, text filled in) that Script Runner can catch it even before the form submitted?
Hello, Does this also work for my custom field of type "select list (single choice)"?
@RVal
I have the same question as @Sandra Meessen
I am trying to copy the value of my "select list (single choice)" from parent to child on an issue created event.
What would that script look like?
It looks like you're new here. Sign in or register to get started.