Event to listen to Project Role update in Jira Cloud

Katrín Ósk Hafsteinsdóttir
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 15, 2024

I would like to be able to send an email when a user is added or removed from Project Role in a project in Jira Software Cloud.

In Jira Server I used Script Listener in Scriptrunner and there I could notify with email when a user was added/removed from Project Role while listening to 'ProjectRoleUpdatedEvent'.

I am looking for a way to get the same functionality in Jira Cloud.

I have looked into what is available in Scriptrunner (Script Listener), Webhooks and Jira Automation and have not found anything useful.

It seems to me that 'Project Updated' event is not triggered on role update.

Is there a way for me to use REST API or some event listnening to audit log?

I have not used REST API calls much so if someone could give me some idea how to start it would be much appreciated.

1 answer

1 accepted

3 votes
Answer accepted
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 15, 2024

Hi Katrin,

I can confirm inside of ScriptRunner for Jira cloud that script listeners do not have a Project Role Updated event because Atlassian does not send a webhook event when an admin updates a project role.

This means the closest you can do is to have a listener script which runs on the Project Updated event.

However, you can call your script's Get Audit Records API to get the audit log records.

This means your script will start by fetching the audit log records, and I have an example that you can run on the script console here to see how to get the audit log records for reference.

In this example, if you uncomment line 12, it will return the audit log records for the updated project role action.

You can then check if this update happened in the project the listener ran for.

If it was you can then call the Send Notification API to send an email notification, and we have an example of calling this API in a script listener here for reference.

Using this information, you can write a script to solve your requirements.

I hope this information helps.

Regards,

Kristian

Katrín Ósk Hafsteinsdóttir
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 15, 2024

Hi Kristian,

Thank you for this, this helps a lot.

I'm going to try this out.

Best regards,

Katrín

Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 15, 2024

Hi Katrin,

I am glad I was able to help you solve your requirements.

Regards,

Kristian

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events