Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,361,270
Community Members
 
Community Events
168
Community Groups

is there a way to disable email notification from changes that my Adaptavist script makes?

Hi - I can't disable email notification fundamentally (via Jira's Notification schemes) but I have an Adaptavist script that runs daily and generates hundreds of email notifications due to the issue updates it makes - Is there a clever way to suppress just notifications that this job causes?

 

Thanks

Carl

1 answer

0 votes

Hi @Carl Sjoquist ,

That should be possible using the DO_NOT_DISPATCH option with your issue manager.

You need update issue with IssueManager with dispatch option DO_NOT_DISPATCH and parameter sendmails false.

Here is an example:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption

def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def issueManager = ComponentAccessor.getIssueManager()
issueManager.updateIssue(user, event.issue, EventDispatchOption.DO_NOT_DISPATCH, false)

 

Documentation can be found here:

https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/issue/IssueManager.html#updateIssue-com.atlassian.jira.user.ApplicationUser-com.atlassian.jira.issue.MutableIssue-com.atlassian.jira.event.type.EventDispatchOption-boolean- 

Looks perfect, just what we would need, but we just moved to the cloud.  Is there an equivalent function available in the cloud version?    sorry, I should have mentioned that up front.

Dirk Ronsmans Community Leader Nov 09, 2020

Hey @Carl Sjoquist ,

On cloud this should be even easier. The cloud app for Scriptrunner uses the REST API (your script will be different too).

A method exists to edit an issue https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put 

and this call also has a property "notifyUsers" which you can set to "false"

notifyUsers

boolean

Whether a notification email about the issue update is sent to all watchers. To disable the notification, administer Jira or administer project permissions are required. If the user doesn't have the necessary permission the request is ignored.

Default: true

Sweet, thanks so much, I'll give this a try asap!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Online AMA this week: Your project management questions answered by Jira Design Lead James Rotanson

We know that great teams require amazing project management chops. It's no surprise that great teams who use Jira have strong project managers, effective workflows, and secrets that bring planning ...

205 views 1 6
Read article

Atlassian Community Events