I am trying to Restrict issue link create only for current project
Many thanks in advance.
Hi,
You can use ScriptRunner Listener to delete link if linked issue is not from current project.
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.Issueimport com.atlassian.jira.issue.MutableIssueimport com.atlassian.jira.issue.link.IssueLinkimport com.atlassian.jira.event.issue.IssueEventimport com.atlassian.jira.event.issue.link.IssueLinkCreatedEventdef issueLinkManager = ComponentAccessor.getIssueLinkManager()Issue currentIssue = event.getIssueLink().getSourceObject()def currentProject = currentIssue.projectObject.namedef linkedIssuedef user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()issueLinkManager.getOutwardLinks(currentIssue.id).each { issueLink -> linkedIssue = issueLink.destinationObject if( linkedIssue.projectObject.name != currentProject ){ issueLinkManager.removeIssueLink(issueLink, user)} }
Hello,
It is not possible.
You could use this add-on for it:
https://marketplace.atlassian.com/apps/1216498/easy-links-for-jira?hosting=server&tab=overview
Hi @reza azad,
Welcome to the community.
You can do this by editing the permission scheme for your project (You must be an Administrator to do that). You should make sure, that the permission scheme is used only in your project, otherwise create a copy, edit that and assign it to your project.
There is a permission for linking issues. If you remove all associated roles, users and groups, nobody can create an issue link anymore.
i want to my users cant link issue to another project and just can link to current issue project
thanks,i want to write this code in listener and i have this error
unable to resole class "import com.atlassian.jira.event.issue.link.IssueLinkCreatedEvent"
Did you used IssueLinkeCreatedEvent? I have to some errors, but listener work good.
i try this code and don't have any error but i have error in execute
It looks like you're new here. Sign in or register to get started.