Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,362,722
Community Members
 
Community Events
168
Community Groups

Customising "You can't view this issue" screen

If a user attempts to view an issue they don't have permission for, say they're following a link from a document to an old project that has had the 'Browse Project' permission removed, they currently get a page saying "You can't view this issue, It may have been deleted or you don't have permission to view it."

Is there anyway to customise this screen?  We're required to have access to all old issues for safety reasons, but we also have about 70 projects that are no longer being worked on and haven't been for years.  I'd like to hide them from general users, but in the rare case somebody does need to access one I want to make it clear what to do.

1 answer

1 accepted

1 vote
Answer accepted
Mirek Community Leader Nov 21, 2019

Hi @cameronshiell ,

Actually a good question

There might be a page (template) that you can probably modify on the server, but without impacting the files you can try to create a redirection to a page or something that would give you information about projects, contact information, etc.

You should achieve it by adding a piece of JS code into your Announcement Banner..

How would the JS look like?

The idea behind the code is that when you load that error page containing specific element that is unique (in that case DIV with ID):

error-image.error-image-canNotBeViewed

you can do something (in that case whatever you want). I suggest a redirection somewhere (to a Confluence page for example), but you can also try to modify the page using JS if you know how to do it (of course)

So the final code would be something simple like this..

<script type="text/javascript">
jQuery(window).load(function(){

if (AJS.$("span.error-image.error-image-canNotBeViewed").length !== 0) {

var new_path = "https://google.com"

window.location.replace(new_path);
console.log("Redirection to a new page");
return false;

}
});
</script>

I hope it helps :)

This is a cool trick.

Like Mirek likes this

That's a really elegant answer, thanks!

Like Mirek likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events