I have read thatsolved answer
i am missing: which library do i have to import for 'Group'. I wrote following lines:
CustomField watcherField = customFieldManager.getCustomFieldObjectByName( "customfield_10702" ) IssueChangeHolder changeHolder = new DefaultIssueChangeHolder(); Group watcherGroup = componentManager.getUserUtil().getGroup("HWSWBeobachter") customField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(watcherField),watcherGroup),changeHolder); customField.store()
I hab two errors:
How can i get the user and usergroup list?
thank you
Community moderators have prevented the ability to post new answers.
meanwhile problems is solved step-by-step witch the the answer questions.
Sooo: how to set the question solved itself ?
Solution was easier than expected.
I should send a collection instead of an object
List<Group> groupList = new ArrayList<Group>() groupList.add(watcherGroup) orderableField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(orderableField),groupList),changeHolder);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Solution was easier than expected.
I should send a collection instead of an object
List<Group> groupList = new ArrayList<Group>() groupList.add(watcherGroup) orderableField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(orderableField),groupList),changeHolder);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
meanwhile i found how to get user and usergroup.
import com.atlassian.crowd.embedded.api.Group Group watcherGroup = componentManager.getUserUtil().getGroupObject("HWSWBeobachter") OrderableField orderableField = componentManager.getFieldManager().getOrderableField("customfield_10702") IssueChangeHolder changeHolder = new DefaultIssueChangeHolder(); orderableField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(orderableField),watcherGroup),changeHolder);
I received some exceptions:
from the log:
[onresolve.jira.groovy.GroovyRunner] The script failed : javax.script.ScriptException: javax.script.ScriptException: java.lang.ClassCastException: com.atlassian.crowd.embedded.impl.ImmutableGroup cannot be cast to java.util.Collection
[onresolve.jira.groovy.GroovyFunctionPlugin] Error executing post-function
javax.script.ScriptException: javax.script.ScriptException: java.lang.ClassCastException: com.atlassian.crowd.embedded.impl.ImmutableGroup cannot be cast to java.util.Collection
is there a missing cast?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.