I need help!
I need a script that I could add to the post-funcsion
I need the script to work out when the user clicks on the "approve" button and that he would be automatically added to the list of "approved users".
And if the user clicks on the "do not approve" button, then he should also automatically be added to the list with users who "do not approveed users" the request.
Hi @Alibek_Malikov ,
Please refer below this may help
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.issue.fields.CustomField import com.atlassian.jira.user.ApplicationUser CustomField multiUser = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("fieldName") List<ApplicationUser> users = issue.getCustomFieldValue(multiUser) if(users == null) users = new ArrayList<>(); users.add(ComponentAccessor.getUserManager().getUserByName("username")) issue.setCustomFieldValue(multiUser, users);
!!!I use this script in the post-function but it gives an error!!!
The script could not be compiled: <pre>org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script23.groovy: 9: unexpected token: ; @ line 9, column 28. users = new ArrayListlt;>(); ^ 1 error </pre>.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.