本文整理汇总了Java中com.atlassian.jira.user.ApplicationUser类的典型用法代码示例。如果您正苦于以下问题:Java ApplicationUser类的具体用法?Java ApplicationUser怎么用?Java ApplicationUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationUser类属于com.atlassian.jira.user包,在下文中一共展示了ApplicationUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addHubWorkflowToJira
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
public JiraWorkflow addHubWorkflowToJira() {
try {
JiraWorkflow hubWorkflow = jiraServices.getWorkflowManager()
.getWorkflow(HubJiraConstants.HUB_JIRA_WORKFLOW);
if (hubWorkflow == null) {
final WorkflowDescriptor workflowDescriptor = getWorkflowDescriptorFromResource();
hubWorkflow = new ConfigurableJiraWorkflow(HubJiraConstants.HUB_JIRA_WORKFLOW, workflowDescriptor,
jiraServices.getWorkflowManager());
final ApplicationUser jiraAppUser = getJiraSystemAdmin();
if (jiraAppUser == null) {
logger.error("Could not find any JIRA System Admins to create the workflow.");
return null;
}
jiraServices.getWorkflowManager().createWorkflow(jiraAppUser, hubWorkflow);
logger.debug("Created the Hub Workflow : " + HubJiraConstants.HUB_JIRA_WORKFLOW);
}
return hubWorkflow;
} catch (final Exception e) {
logger.error("Failed to add the Hub JIRA worflow.", e);
settingService.addHubError(e, "addHubWorkflow");
}
return null;
}
示例2: initJiraContext
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
private JiraContext initJiraContext(final String jiraAdminUsername, String jiraIssueCreatorUsername) {
logger.debug(String.format("Checking JIRA users: Admin: %s; Issue creator: %s", jiraAdminUsername, jiraIssueCreatorUsername));
if (jiraIssueCreatorUsername == null) {
logger.warn(String.format(
"The JIRA Issue Creator user has not been configured, using the admin user (%s) to create issues. This can be changed via the Issue Creation configuration",
jiraAdminUsername));
jiraIssueCreatorUsername = jiraAdminUsername;
}
final ApplicationUser jiraAdminUser = getJiraUser(jiraAdminUsername);
final ApplicationUser jiraIssueCreatorUser = getJiraUser(jiraIssueCreatorUsername);
if ((jiraAdminUser == null) || (jiraIssueCreatorUser == null)) {
return null;
}
final JiraContext jiraContext = new JiraContext(jiraAdminUser, jiraIssueCreatorUser);
return jiraContext;
}
示例3: hasAdminPermission
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
public boolean hasAdminPermission() {
ApplicationUser user = getLoggedInUser();
if (user == null) {
return false;
}
return globalPermissionManager.hasPermission(GlobalPermissionKey.ADMINISTER, user);
}
示例4: getJiraSystemAdmin
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
private ApplicationUser getJiraSystemAdmin() {
final Collection<ApplicationUser> jiraSysAdmins = getJiraServices().getUserUtil().getJiraSystemAdministrators();
if (jiraSysAdmins == null || jiraSysAdmins.isEmpty()) {
return null;
}
return jiraSysAdmins.iterator().next();
}
示例5: updateIssue
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
private Issue updateIssue(final MutableIssue issueToUpdate, final AssignValidationResult assignValidationResult, final ApplicationUser userMakingChange, final String assigneeId) {
issueToUpdate.setAssigneeId(assigneeId);
final UpdateIssueRequest issueUpdate = UpdateIssueRequest.builder().eventDispatchOption(EventDispatchOption.ISSUE_UPDATED).sendMail(false).build();
logger.debug("Updating issue with assigned user ID: " + assigneeId);
final Issue updatedIssue = jiraServices.getIssueManager().updateIssue(userMakingChange, issueToUpdate, issueUpdate);
return updatedIssue;
}
示例6: getJiraUser
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
private ApplicationUser getJiraUser(final String jiraUsername) {
final UserManager jiraUserManager = jiraServices.getUserManager();
final ApplicationUser jiraUser = jiraUserManager.getUserByName(jiraUsername);
if (jiraUser == null) {
logger.error(String.format("Could not find the JIRA user %s", jiraUsername));
return null;
}
return jiraUser;
}
示例7: printFields
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
public static void printFields(final HubJiraLogger logger, final FieldManager fieldManager, final ApplicationUser user, final Issue issue) {
try {
final Set<NavigableField> navFields = fieldManager.getAllAvailableNavigableFields();
for (final NavigableField field : navFields) {
logger.debug("NavigableField: Id: " + field.getId() + "; Name: " + field.getName() + "; nameKey: " + field.getNameKey());
}
} catch (final Exception e) {
logger.debug("Error getting fields: " + e.getMessage());
}
}
示例8: getJiraSystemAdministrators
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@Override
public Collection<ApplicationUser> getJiraSystemAdministrators() {
if (user != null) {
final List<ApplicationUser> systemAdmins = new ArrayList<>();
systemAdmins.add(user);
return systemAdmins;
}
return null;
}
示例9: createIssue
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
private Issue createIssue(final Long id, final Long projectId, final String projectName, final Status status, final ApplicationUser assignee) {
final IssueMock issue = new IssueMock();
issue.setId(id);
final ProjectMock project = new ProjectMock();
project.setId(projectId);
project.setName(projectName);
issue.setProject(project);
issue.setStatusObject(status);
issue.setDescription(ISSUE_DESCRIPTION);
issue.setCreated(new Timestamp(System.currentTimeMillis()));
issue.setUpdated(new Timestamp(System.currentTimeMillis()));
issue.setAssignee(assignee);
return issue;
}
示例10: validateClone
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@Override
public CloneValidationResult validateClone(final ApplicationUser arg0, final Issue arg1, final String arg2, final boolean arg3, final boolean arg4,
final boolean arg5,
final Map<CustomField, Optional<Boolean>> arg6) {
// TODO Auto-generated method stub
return null;
}
示例11: onLoginEvent
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@EventListener
public void onLoginEvent(LoginEvent loginEvent) {
ApplicationUser applicationUser = loginEvent.getUser();
metricCollector.userLoginCounter((applicationUser != null) ? applicationUser.getUsername() : "");
}
示例12: onLogoutEvent
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@EventListener
public void onLogoutEvent(LogoutEvent logoutEvent) {
ApplicationUser applicationUser = logoutEvent.getUser();
metricCollector.userLogoutCounter((applicationUser != null) ? applicationUser.getUsername() : "");
}
示例13: getAssignee
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@Override
public ApplicationUser getAssignee() {
return assignee;
}
示例14: hasPermissionToView
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@Override
public boolean hasPermissionToView(final ApplicationUser arg0, final Type arg1, final String arg2) {
// TODO Auto-generated method stub
return false;
}
示例15: hasPermissionToEdit
import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@Override
public boolean hasPermissionToEdit(final ApplicationUser arg0, final Project arg1) {
return false;
}