Bitbucket detecting permission change with ScripRunner

Bertrand Delaitre March 12, 2021

Hi all,

I'm a totally newbie in the use of ScriptRunner and Groovy. Here is what I need to do: detect any modification (add, modify, delete) in the permissions for any project, and send a mail to a specific address when a modification is detected, including :

  • project key,
  • current user name (the one who makes the modification),
  • new permission (if any),
  • old permission (if any),
  • affected user name

 

I'm quite sure this is possible using kind of ProjectPermissionModifiedEvent event but I'm not able to define the needed script(s) by myself.

 

Any help is welcome

1 answer

1 accepted

0 votes
Answer accepted

Hi Bertrand

Yes, 'ProjectPermissionModifiedEvent' is the correct event type.

We have updated our documentation page with an example for project permission modifications :

https://docs.adaptavist.com/sr4bib/latest/features/listeners/built-in-listeners/send-custom-email-on-event

You can access the event info you need as :

  • Affected user name : event.affectedUser.displayName
  • User who changed the permission : event.user.displayName
  • Project key : event.project.key
  • Previous project permission : event.oldValue
  • New project permission : event.newValue

Please let us know if you'd like further help!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events