I have a custom escalation service that is calculating and setting a custom field using a issueInputParameters.addCustomFieldValue() call. The script runs every 30 minutes and I would like to avoid sending an email every time it runs. Is there any way to update the field(s) without sending the update email?
Do you call IssueService.update(ApplicationUser user, IssueInputParameters input) yourself? If so, instead use IssueService.update(Applicationuser user, IssueInputParameters input, EventDispatchOption.DO_NOT_DISPATCH, boolean false)
If you aren't calling IssueService.Update yourself, then you'll have to handle all the calls to issueservice and issueinputparameters yourself.
Thanks that did it. Here is the generic code syntax I used:
import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.issue.customfields.manager.OptionsManager
IssueService issueService = ComponentAccessor.getComponent(IssueService);
def customFieldManager = ComponentAccessor.getComponent(CustomFieldManager);
def optionsManager = ComponentAccessor.getComponent(OptionsManager);
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters()
def user = ComponentAccessor.getJiraAuthenticationContext().loggedInUser
def issue = issue;
def cfPI = customFieldManager.getCustomFieldObjects(issue).find {it.name == "Priority Index"};
issueInputParameters.addCustomFieldValue(cfPI.id, 10.toString());
def update = issueService.validateUpdate(user, issue.id, issueInputParameters)
issueService.update(user, update, com.atlassian.jira.event.type.EventDispatchOption.DO_NOT_DISPATCH, true);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Happy to help! :)
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.