I want to implement event handler for ProjectPermissionModificationRequestedEvent, for that I need to compare event.newValue with the string "PROJECT_ADMIN" or other project related permissions.
I have tried
if(event.newValue == "PROJECT_ADMIN")
{
do something
}
else
{
event.cancel("custom msg")
}
But this is not as expected, like even if the value of event.newValue is PROJECT_ADMIN (as printed through log.warn() ) if block doesn't get executed.
Kindly someone suggest the method to achieve the same.
Thanks.
Hi Prayag,
I think the reason this is not working as expected is because event.newValue is not a String, but rather a Permission. To check its value you will therefore need to do something like the following:
import com.atlassian.bitbucket.permission.Permission
if (event.newValue == Permission.PROJECT_ADMIN) { /* etc. */ }
Hope this helps!
Joanna Choules, Adaptavist Product Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Learn why Compass was built to tackle dev experience at scale. See how Atlassian uses it to boost visibility, reduce cognitive load, and drive consistency—plus tips to get started and customize your IDP for stronger team engagement.
Join the webinar ✨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.