Hello again!
I have created a custom application that talks to the JIRA API. The application changes a custom field back and forth which results in a lot of mails being sent to everyone in our company. I cannot figure out how to disable this and from what i've read so far, it might not even be possible?
Is it possible to disable email notifications when a custom field is changed on an issue? If so, can someone please guide me in the right direction?
Thanks for the awesome support by the way!
Community moderators have prevented the ability to post new answers.
JIRA emails on changes to an issue, not a field. The closest you can get is to just turn off notifications for "issue updated", but that will stop mailing people for all updates (note - not workflow, comments, create etc, just issue updates, which are mostly edits)
The other option is to turn off the updated event as above, but also add a "listener" that can catch "issue updated" and send a separate email out based on some logic you can code for. i.e "any edit that was not just that one field we changed". But that needs add-ons.
as John pointed out, IssueSevices is the suggested method to do this but I found this slow and unreliable. I also noted in older versions Atlassian does not even use this for their CSV importer (this may no longer be true)
I do this one of two ways.
Leaves a history..
issue.SetCustomFieldValue();
ComponentAccessor.getIssueManager().updateIssue();
Leaves no history.. Note that the Class of the NewValue must be in the same class of the field (ie..if it is an option, it must be an Option).
cf.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(cf),NewValue), changeHolder)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the response! I'm a bit confused though, does this require that I change code in my Jira installation? Because the application I have made is a web application written in .NET and I all it does is to communicate with the REST API provided by jira. This information seems to be for addons that are created either directly in the Jira installation or on top of it? I hope i'm making some form of sense atleast, sorry for my confusion. Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As you suspect, the answer you've been given here was about writing code to implement inside JIRA (either via an add-on or possibly hacking the core). The REST API you are using simply updates the issue from the outside of JIRA, which triggers the "issue updated" event. You need to work inside JIRA to change this behavior, that's what my answer focussed on as I assumed you weren't talking about add-ons or core code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey again!
Thanks for all your answers, it has helped me a lot. I decided to implement a REST API for my JIRA application (https://developer.atlassian.com/docs/atlassian-platform-common-components/rest-api-development/rest-plugin-module), in order to get my ASP.NET application to communicate with something that is connected directly to JIRA. I have implemented a way to send the information that is needed to update an issue but now i'm having problems with using these methods you guys have provided. It seems like the rest API doesnt have any form of way to change things in JIRA directly. The classes are not there.
Am I doing something wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>It seems like the rest API doesnt have any form of way to change things in JIRA directly Eh? The REST API is built for reading and updating JIRA issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use IssueService to do the updates and pass the sendMail argument as false.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.