Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Disable notifications when customfield is edited

eggbeaterman October 12, 2015

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!

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Nic Brough -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.
October 12, 2015

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.

1 vote
Jeff Louwerse
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 12, 2015

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)

https://developer.atlassian.com/jiradev/jira-platform/guides/issues/guide-performing-issue-operations

 

I do this one of two ways.

Leaves a history..

issue.SetCustomFieldValue();
ComponentAccessor.getIssueManager().updateIssue();

https://docs.atlassian.com/jira/latest/com/atlassian/jira/issue/IssueManager.html#updateIssue%28com.atlassian.crowd.embedded.api.User,%20com.atlassian.jira.issue.MutableIssue,%20com.atlassian.jira.event.type.EventDispatchOption,%20boolean%29

 

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)

https://docs.atlassian.com/jira/latest/com/atlassian/jira/issue/fields/OrderableField.html#updateValue%28com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem,%20com.atlassian.jira.issue.Issue,%20com.atlassian.jira.issue.ModifiedValue,%20com.atlassian.jira.issue.util.IssueChangeHolder%29

 

eggbeaterman October 12, 2015

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

Nic Brough -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.
October 12, 2015

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.

0 votes
eggbeaterman October 14, 2015

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? 

Nic Brough -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.
October 14, 2015

>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.

0 votes
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 12, 2015

Use IssueService to do the updates and pass the sendMail argument as false.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events