The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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!