Class ManualTriggerServiceImpl
java.lang.Object
com.codebarrel.jira.plugin.automation.service.ManualTriggerServiceImpl
- All Implemented Interfaces:
ManualTriggerService
-
Constructor Summary
ConstructorsConstructorDescriptionManualTriggerServiceImpl(LocaleManager localeManager, GroupManager groupManager, PermissionManager permissionManager, GlobalPermissionManager globalPermissionManager, IssueService issueService, ProjectService projectService, I18nHelper.BeanFactory beanFactory, com.atlassian.cache.CacheManager cacheManager, IssueBeanTransformer issueBeanTransformer, AutomationConfigService configService, JiraAutomationExecutionService automationExecutionService) -
Method Summary
Modifier and TypeMethodDescriptionexecuteRule(ApplicationUser loggedInUser, Long projectId, Long ruleId, String issueKey) Attempts to execute a rule with a manual trigger.executeScheduled(ApplicationUser loggedInUser, Long projectId, Long ruleId) Used to test scheduled rules in the admin section.List<com.codebarrel.automation.api.config.RuleConfigBean> getManualRulesForUser(ApplicationUser loggedInUser, Issue issue) Retrieves all manual rules the provided user is allowed to see.voidruleModified(com.codebarrel.automation.api.config.RuleConfigBean existingRule, com.codebarrel.automation.api.config.RuleConfigBean newRule) Notifies the service when a rule is edited.
-
Constructor Details
-
ManualTriggerServiceImpl
@Inject public ManualTriggerServiceImpl(LocaleManager localeManager, GroupManager groupManager, PermissionManager permissionManager, GlobalPermissionManager globalPermissionManager, IssueService issueService, ProjectService projectService, I18nHelper.BeanFactory beanFactory, com.atlassian.cache.CacheManager cacheManager, IssueBeanTransformer issueBeanTransformer, AutomationConfigService configService, JiraAutomationExecutionService automationExecutionService)
-
-
Method Details
-
getManualRulesForUser
public List<com.codebarrel.automation.api.config.RuleConfigBean> getManualRulesForUser(ApplicationUser loggedInUser, Issue issue) Description copied from interface:ManualTriggerServiceRetrieves all manual rules the provided user is allowed to see.- Specified by:
getManualRulesForUserin interfaceManualTriggerService- Parameters:
loggedInUser- the logged in userissue- the issue to fetch manual rules for- Returns:
- list of rules
-
executeScheduled
Description copied from interface:ManualTriggerServiceUsed to test scheduled rules in the admin section. Checks the user is a project admin. if project is null, it assumes global context and checks for Admin permission- Specified by:
executeScheduledin interfaceManualTriggerService- Parameters:
loggedInUser- the logged in userprojectId- project we're executing inruleId- the rule to execute- Returns:
- Errors when executing
-
executeRule
public ErrorCollection executeRule(ApplicationUser loggedInUser, Long projectId, Long ruleId, String issueKey) Description copied from interface:ManualTriggerServiceAttempts to execute a rule with a manual trigger.The user needs to be able to browse to the issue and the rule has to exist.
- Specified by:
executeRulein interfaceManualTriggerService- Parameters:
loggedInUser- the logged in userprojectId- project we're executing inruleId- the rule to executeissueKey- the key to execute against- Returns:
- Errors when executing
-
ruleModified
public void ruleModified(com.codebarrel.automation.api.config.RuleConfigBean existingRule, com.codebarrel.automation.api.config.RuleConfigBean newRule) Description copied from interface:ManualTriggerServiceNotifies the service when a rule is edited. THis can be used to clear caches etc.- Specified by:
ruleModifiedin interfaceManualTriggerService- Parameters:
existingRule- The old rule config. May be null for deleted rules/created rulesnewRule- the new rule being updated
-