Hi, I use script to set custom field on issue create:
import com.atlassian.jira.component.ComponentAccessor
import static java.lang.Math.*
import java.sql.Timestamp
def Begin_Date = ComponentAccessor.getCustomFieldManager().getCustomFieldObject('custmofield_10200')
issue.setCustomFieldValue(Begin_Date, new Timestamp(new Date().time))
But its dont work, and I get error:
The following log information was produced by this execution. Use statements like:log.info("...") to record logging information.
2019-07-29 15:11:39,708 ERROR [workflow.ScriptWorkflowFunction]: ************************************************************************************* 2019-07-29 15:11:39,708 ERROR [workflow.ScriptWorkflowFunction]: Script function failed on issue: CR-20406, actionId: 1, file: <inline script> java.lang.NullPointerException at com.atlassian.jira.issue.IssueImpl.getCustomFieldValue(IssueImpl.java:896) at com.atlassian.jira.issue.IssueImpl.setCustomFieldValue(IssueImpl.java:906) at com.atlassian.jira.issue.MutableIssue$setCustomFieldValue$1.call(Unknown Source) at Script505.run(Script505.groovy:11)
Help me please =)
Hello @Владислав Яшин
You are using setCustomFieldValue method on issue object, this is something which will not work.
Details as to what you should use are here
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.