I'd like to restrict certain user groups from deleting issue links.
We cannot revoke their link issue permission from the jira project, as they need it to establish parent link from cross projects.
So, is it possible to hide/restrict the 'delete issue link' on the jira ticket.
Hi @MRANJ
Thanks for the answer.
Unfortunately, you can't restrict "link deletion" without affecting "create link" in native Jira.
For an alternative solution, in Jira Data Center, you can use ScriptRunner.
You can use Behaviours in Scriptrunner to hide/remove the "Delete link" UI element for specific groups or roles.
If you have ScriptRunner, please let me know so we can dive deeper into it.
Hi @Gor Greyan
Yes, I have Adptavist script runner.
Behaviour applies only on create and edit field. So, it will allow the users to delete the links from view screen.
Yes, we can defenetily dive deeper.
Thanks
Mansih
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @MRANJ
Thanks for the reply.
It should be worked via Listener.
Go to Scriptrunner --> Listener --> Custom Listener
Choose the Issue Linked Deleted event. (See the screenshot).
Use the following script.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLink
import com.atlassian.jira.issue.Issue
import org.apache.log4j.Logger
def log = Logger.getLogger("com.example.linkdeletion")
def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def groupManager = ComponentAccessor.groupManager
// Check if user is restricted
def restricted = groupManager.isUserInGroup(user, "restricted-link-users")
if (restricted) {
log.warn("User ${user.name} attempted to delete a link between ${event.sourceIssue?.key} and ${event.destinationIssue?.key}")
// Optionally, recreate the deleted link to reverse the action
// def issueLinkManager = ComponentAccessor.issueLinkManager
// issueLinkManager.createIssueLink(sourceIssue.id, destinationIssue.id, event.linkType.id, 0L, user)
}
Let me know, if you have any questions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Gor Greyan ,
Great Suggestion, Indeed it does meet the requirement. However, it creates unwanted history as it will re-create the links. I suppose we have to live with that :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @MRANJ
Yes, it is not well for issue history :D Unfortunately, I don't know any other way for now, sorry for that :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.