Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

It is possible to hide any links in More menu?

Anders
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!
January 17, 2020

 My target is to hide Move and Convert if current issue have linked issue(s) with type equal, for example, "SomeIssueType".

I suppose to use "Hide system or plugin UI element" in Script Fragments.

Hide what:

com.atlassian.jira.plugin.system.issueoperations:move-issue

But what is conditions in this case? A la "issue.links... != 'SomeIssueType'" ?

1 answer

1 accepted

1 vote
Answer accepted
PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2020

Hi @Ander 

Yes, this approach should work. You have identified the correct item to hide.

As for the condition despite the fact that the fragment is called "hide element", we must return a "false" value to hide and "true" to show the element.

There is no direct access to issue links from the issue object. To get issue links, you need to grab the issueLinkManager component. 

Start with something like this:

import com.atlassian.jira.component.ComponentAccessor
def issueLinkManager = ComponentAccessor.issueLinkManager
!issueLinkManager.getIssueLinks(issue.id).any{it.destinationObject.issueType.name == 'SomeIssueType'}

You may need to tweak this a bit. There is destinationObject and sourceObject and those will depend on the directionality of your links.

Anders
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!
January 18, 2020

Peter-Dave, thank you very much! 

Suggest an answer

Log in or Sign up to answer