如何使用javascript在Jira 5.1.8的问题链接弹出窗口中隐藏一些问题链接类型? [英] How to hide some issue link types in the Issue Link pop up window for Jira 5.1.8 using javascript?

查看:139
本文介绍了如何使用javascript在Jira 5.1.8的问题链接弹出窗口中隐藏一些问题链接类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向外隐藏一些问题链接&使用java脚本从链接问题弹出窗口转发链接类型的字符串。

I wanted to hide some issue link outward & inwards strings of Link type from the Link Issues Popup Window using java script.

我尝试使用java脚本,但我没有从java脚本获取弹出屏幕。

I have tried using java script but I am not getting the popup screen from the java script.

请参阅下面的截图:

有谁能告诉我如何在java脚本中显示此弹出屏幕?
有没有其他方法可以隐藏这个?

Can anyone tell me how can I get this popup screen in the java script? Is there any other method to hide this?

谢谢&问候,

Renuka。

推荐答案

隐藏每页克隆问题链接:

编辑文件 system-webresources-plugin.xml (应该在/ atlassian-jira / WEB-INF / classes /),并添加到< web-resource key =jira-fields> 此代码:

edit the file system-webresources-plugin.xml (should be at /atlassian-jira/WEB-INF/classes/), and add to <web-resource key="jira-fields"> this code:

    <resource type="download" name="myScript.js" location="/includes/jira/field/script.js">
        <param name="source" value="webContextStatic"/>
    </resource>

,而不是 /includes/jira/field/myScript.js 写这个:

AJS.$(document).ready(function() {
    if (AJS.$("#link-type option[value*='clon']").size() > 0) {
        // will work even when right clicking on More 
        // Actions->Link & open it into a new window
        AJS.$("#link-type option[value*='clon']").remove()
    } else if (AJS.$("#link-issue").size() > 0) {
        // will work in case the link menu showing via popup
        AJS.$("#link-issue").click(function(){
            // wait for the popup to show, and remove the clone options
            setTimeout(function (){
                AJS.$("#link-type option[value*='clon']").remove();
             }, 300);
        });
    }
});

重新启动Jira,它就是它!

restart Jira and it that it!

脚本将一个功能附加到链接菜单打开,而不是给菜单加载0.3秒,并删除不需要的项目。如果它不适合您,请尝试将超时从300提高到500-1000。

The script attaches a function to the link-menu opening, than gives the menu 0.3 seconds to load, and removes the unwanted items. If it doesn't work well for you, try to raise the timeout from 300 to 500-1000.

在jira 4上,改为运行:

On jira 4, run instead:

    AJS.$("#issue-link-link-type option[value*='clon']").remove();

这篇关于如何使用javascript在Jira 5.1.8的问题链接弹出窗口中隐藏一些问题链接类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆