Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict Delete Issue Link option in an existing link from jira ticket

MRANJ June 18, 2025

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.

 

1 answer

0 votes
Gor Greyan
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 Leaders.
June 18, 2025

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.




MRANJ June 19, 2025

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 

 

Gor Greyan
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 Leaders.
June 22, 2025

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.Screenshot 2025-06-22 184952.png

MRANJ June 23, 2025

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 :-)

Gor Greyan
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 Leaders.
June 23, 2025

Hi @MRANJ

Yes, it is not well for issue history :D  Unfortunately, I don't know any other way for now, sorry for that :) 


Suggest an answer

Log in or Sign up to answer