It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

It is possible to hide any links in More menu?

 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

0 votes
Answer accepted

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.

Peter-Dave, thank you very much! 

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you