You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi Team ,
We have recently upgrade Jira application in our lower instance.
In testing we observed that existing announcement banner script user hide create issue option in Jira is not working.
Below is the script used to hide the create button in announcement banner .
{code:title=Bar.java|borderStyle=solid}
//////////////////////////////////////////////////////////////////////////////////////////////////////
// DON'T ALLOW ISSUES TO BE CREATED FROM 'CREATE ISSUE' WINDOW
//////////////////////////////////////////////////////////////////////////////////////////////////////
function disableProjectsCreateIssue() {
var isCreateIssuePage = AJS.$('#create-issue-dialog').is(':visible');
if (isCreateIssuePage === true) {
var project = AJS.$('#project-field').val();
if ((project == "Ticket (TIC)") || (project == 'External Issue (EXT)') || (project == 'Enterprise Customer Ticket (ECET)') || (project == 'Embedded Customer Internal Ticket (ECIT)') || (project == 'Server Customer Engineering Ticket (SCET)')) {
AJS.$('.issue-setup-fields').css({
border: '0px'
});
AJS.$('.content').hide();
AJS.$('.buttons-container.form-footer > .buttons > .qf-create-another').hide();
AJS.$('.buttons-container.form-footer > .buttons > #create-issue-submit').hide();
AJS.$('.qf-field.qf-field-issuetype.qf-required > .field-group > :not(:last)').hide();
AJS.$('.qf-field.qf-field-issuetype.qf-required > .field-group> .description ').hide();
AJS.$('.qf-field.qf-field-issuetype.qf-required > .field-group ').append('This project is not allowed to create issues.');
}
}
}
{code}
Please help us to fix this issue as it is blocking our upgrade activity.
Thank you,
Varun
We had a similar problem in our instance.
From JIRA v 9.x the loading of .js resources is being done in defer phase on the following pages:
-Issue View
-Project-centric Issue Navigator
-Global Issue Navigator
-Dashboard (including system dashboard)
For the further details please check:
https://confluence.atlassian.com/jiracore/preparing-for-jira-9-0-1115661092.html#PreparingforJira9.0-app_headerAppheaderupdates:~:text=App%20header%20updates,INCLUDES%20BREAKING%20CHANGES
What helped to us is the following:
We changed the definition of the script tag from:
<script type="text/javascript">...</script>
to:
<script type="module" defer>...</script>
Then our (different than your) inline script started to work as previously did.
Hopefully this helps somehow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think there's a way to "fix" this. Atlassian have been removing the ability to inject scripts that might break things like this from most of the places that you could.
Reading your script though, I can also say that you don't need it. It's a truly terrible way to do what you want, it doesn't do what you need (there's many ways to create issues, your script only blocks one of them), it's ugly (people expect to be able to do things when they click on a link that says they can) and it can be done in Jira without any scripting.
Change the permission scheme for all of the projects you want to prevent issue create in - take away the permission for "create issue". Users who do not have that permission won't be offered any "create issue" options in the UI, and people doing it via a different route will be told they have no permission to do it.
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.