Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Announcement banner script not working after Jira upgrade to 9.4.1

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

2 answers

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.

This helps on a Jira announcement banner issue.  thanks

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 06, 2023

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.

Suggest an answer

Log in or Sign up to answer