【问题标题】:Jira Plugin user specific settingsJira 插件用户特定设置
【发布时间】:2015-10-30 22:29:17
【问题描述】:

我刚刚开始编写我的第一个 JIRA 插件,我需要实现一些用户特定的设置,例如以下返回的设置:

select * from jiraschema.propertyentry where ENTITY_NAME = 'ApplicationUser'

目前我只能使用 PluginSettingsFactory 保存插件的全局设置,但我需要为每个用户设置不同的设置。有谁知道如何实现这样的事情?

谢谢。

【问题讨论】:

    标签: jira jira-plugin


    【解决方案1】:

    我找到了访问 ApplicationUser 属性的解决方案。这是我的方法,也许对某人有帮助:

        UserPropertyManager userPropertyManager = ComponentAccessor.getUserPropertyManager();
        String propValue = null;
    
        //get a user specific property
        propValue = userPropertyManager.getPropertySet(ComponentAccessor.getJiraAuthenticationContext().getUser()).getAsActualType("workflow-mode").toString();
    
        //set a new user specific prop
        ComponentAccessor.getUserPropertyManager().getPropertySet(ComponentAccessor.getJiraAuthenticationContext().getUser()).setString("my_new_prop_name", "my_new_prop_value");
    

    【讨论】:

      猜你喜欢
      • 2016-12-30
      • 2023-03-07
      • 2021-09-24
      • 1970-01-01
      • 2014-08-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-09
      相关资源
      最近更新 更多