Hi,
I'm using script listener to update custom field based on some calculation
Once the field value is updated all the issue watchers are getting notification on the change (based on our notification scheme)
is there a way to prevent those notifications?
can I add some function to the script the says 'don't notify watchers'?
thanks
Dar
Hello @Dar Kronenblum
How you update custom field?
You need update issue with IssueManager with dispatch option DO_NOT_DISPATCH and parameter sendmails false.
Here is 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)
Hi @Mark Markov
I'm using this function to update the custom field
IssueChangeHolder changeHolder = new DefaultIssueChangeHolder();
cf.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(cf), val), changeHolder);
if I understand correctly, in your example no event will be fired, so there will be no indication in the issue history and no listener will be run, is it true?
thanks
Dar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There will be info in issue history, but no event and no notification.
More info about ways to update issue in Jira with code example you can find here
https://community.atlassian.com/t5/Agile-articles/Three-ways-to-update-an-issue-in-Jira-Java-Api/ba-p/736585
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
thanks a lot!
Apparently the agile board data such as time tracking fields doesn't get updated unless you put 'true' in the send email parameter :(
so I guess the notifications are necessary
thanks anyway
Dar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.