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'" ?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.