I have a script which gets the reporter ID from a service desk form and adds the user to a specific group.
I used the exact same syntax provided in the Adaptavist documentation, yet it doe snot work: https://docs.adaptavist.com/sr4jc/latest/hapi/work-with-groups#add-users-to-a-group
def group = Groups.getByName('jira-developers')
// user can be added to the group by their account id
group.add('user_account_id')
Any help on how to fix this ?
Thank you
Great suggestion provided by @Germán Morales . Since this is related to Scriptrunner add-on, you can also contact the vendor directly for additional technical support.
Lastly, what is the purpose of your group? Is this group for the portal users (reporters) only?
Please advise.
Best, Joseph
Hi @Aisha M , the syntax you copied is correct. The catch is that group.add(accountId) returns a boolean instead of throwing on failure, so a call that doesn't work fails completely silently unless you capture that return value.
Once the logged return value comes back true, the group membership has actually been written.
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.