Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hello team,
I have defined a field of Pick type (nikoPickValues3) with multiple allowed values and try to set values (even simpe ones just to check it)
Trigger code is:
sb = bsf.lookupBean("imServerBean");
var delta = bsf.lookupBean("imIssueDeltaBean");
if(delta.getDocumentID() !=0) {
theReqDocBean = sb.getIssueBean(theRequirementDocumentID);
thePickValuesAllowed = theReqDocBean.getFieldValue(pickValuesAllowedFieldName);
print("###### thePickValuesAllowed are: " + thePickValuesAllowed + " ######");
var values = new java.util.HashSet();
values.add("pick-value1");
values.add("pick-value15");
delta.setPickFieldValue("nikoPickValues3", values);
}
Error is always:
* * * * ERROR * * * * (5): user1 [RMI Executor-thread-5]: Issue.changed.pre: Action cancelled due to unexpected trigger exception in script file: "setTCasePickValues2.js": JavaScript Error: java.lang.NullPointerException
2024-02-05 16:03:52,929 INFO [mksis.IntegrityServer] GENERAL(0): user1 [RMI Executor-thread-5]: mks.ci.exception.IMTriggerException -- mks.frame.triggers.TriggerExceptionVeto: JavaScript Error: java.lang.NullPointerException
at mks.frame.triggers.BaseTriggerManager.fireEventTrigger(BaseTriggerManager.java:159)
at mks.ci.server.engine.LocalTriggerManager.fireEventTrigger(LocalTriggerManager.java:163)
at mks.ci.server.engine.LocalTriggerManager.fireIssueChangedTrigger(LocalTriggerManager.java:887)
at mks.ci.server.engine.LocalTriggerManager.fireIssueChangedTrigger(LocalTriggerManager.java:74
It works the same way for other fields defined as picks
Any ideas if where am I wrong?
Thanks