小编gan*_*oes的帖子

如何在我自己的自定义字段中使用 JIRA AUI 函数 -velocity edit.vm

我正在尝试在我的 JIRA 中使用一些 AUI - 在用 JAVA 编写的我自己的自定义字段的编辑模式下。我找到了这个页面: https: //docs.atlassian.com/aui/latest/sandbox/#,将来我想使用设置一个示例 Auiselect2。

https://docs.atlassian.com/aui/5.5.1/docs/auiselect2.html - 这里写的是,这只是实验性的,那么我应该执行哪些步骤来使用它?在下面的示例中,您可以看到,我试图添加此功能,但它简单地不起作用。我正在使用文档中提到的示例 -

编辑.vm:

$webResourceManager.requireResource("cz.firma.rozy:zakaznik")

<form class="aui">
    <select id="select2-example" multiple>
        <option value="CONF">Confluence</option>
        <option value="JIRA">JIRA</option>
        <option value="BAM">Bamboo</option>
        <option value="JAG">JIRA Agile</option>
        <option value="CAP">JIRA Capture</option>
        <option value="AUI">AUI</option>
    </select>
</form>
Run Code Online (Sandbox Code Playgroud)

和 zakaznik.js

AJS.$(function() {
    AJS.$("#select2-example").auiSelect2();
});
Run Code Online (Sandbox Code Playgroud)

我的 atlassian-plugin.xml 是:

<web-resource key="zakaznik-resources" name="zakaznik Web Resources">
    <dependency>com.atlassian.auiplugin:ajs</dependency>
    <dependency>com.atlassian.auiplugin:jquery</dependency>
    <dependency>com.atlassian.auiplugin:jquery-ui-other</dependency>
    <dependency>com.atlassian.auiplugin:aui-select2</dependency>
    <context>atl.general</context>
    <context>atl.admin</context>
    <resource type="download" name="zakaznik.css" location="/css/zakaznik.css"/>
    <resource type="download" name="zakaznik.js" location="/js/zakaznik.js"/>
    <resource type="download" name="images/" location="/images"/>
    <context>zakaznik</context>
  </web-resource>

...
  <customfield-type name="Pridani zakaznika" i18n-name-key="customer-add.name" key="customer-add" class="cz.firma.rozy.jira.customfields.CustomerCustomField"> …
Run Code Online (Sandbox Code Playgroud)

javascript jquery velocity custom-fields jira-plugin

5
推荐指数
1
解决办法
5042
查看次数