It is possible to hide any links in More menu?

Anders 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
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 January 18, 2020

Peter-Dave, thank you very much! 

Suggest an answer

Log in or Sign up to answer