Hide some of the options in issuelink dropdown is not working in Search issue page.

Narendra Yanamadala
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 11, 2024

Hide some of the options in issuelink dropdown is not working in Search issue page. But working in single issue page.

Below is the code I am using

 

 <web-resource name="Hide Issue Link Options" key="hide-issueLink-options">
        <resource name="HideIssueLinkOptions.js" type="download" location="com/WebResource/HideIssueLinkOptions.js"/>
        <context>atl.general</context>
    </web-resource>

 

function hideIssueLinkOptions() {
         
       AJS.$("#link-issue").click(function(){
          hidelinkType("#link-type");
       });
       AJS.$("#add-links-link").click(function(){
          hidelinkType("#link-type");
       });
       AJS.$("#edit-issue").click(function(){
          hidelinkType("#issuelinks-linktype");
       });
       AJS.$("#create_link").click(function(){
         hidelinkType("#issuelinks-linktype");
       });
   
   AJS.$("#project-field").change(function(){
console.log("On Change");
         hidelinkType("#issuelinks-linktype");
       });
}
function issueLinksList() {
               return ["Work Type","Original Request","Release(s)","is Release of","is SLC Parent of","is SLC Task of"]
        };
function hidelinkType(linkType) {
console.log("Link Name : " + linkType);
var timesRun = 0;
var interval = setInterval(function(){
console.log("LinkCount: " +timesRun)
timesRun += 1;
if(timesRun === 2){
   clearInterval(interval);
}
var hiddenLinkList = issueLinksList();
for(var link of hiddenLinkList) {
console.log(link);
AJS.$(""+linkType+" option[value='"+link+"']").remove();
}
         }, 1000);
};

0 answers

Suggest an answer

Log in or Sign up to answer