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

AJS script failing after upgrade to JIRA 9.4

We're testing an upgrade to v9.4 from v8.19, and the custom scripts we have for ScriptRunner scripted fields are no longer rendering on the issue view page. 

Our scripts output AJS code to update, for example, the ghx-issues-in-epic-table

In the upgraded JIRA product, when viewing an issue the developer tools are showing the error:  "TypeError: AJS.$ is not a function", and the table and field are not displaying as expected. 

I have read over the changes in Preparing for JIRA 9.0 documentation but it's not clear to me how this applies to our usage within the ScriptRunner Scripted Fields. 

Any help or experience with the same challenges would be much appreciated. 
Thanks.

2 answers

1 accepted

0 votes
Answer accepted

Thanks for the help, we found the solution we were looking for. 

Starting with the details on this Preparing for JIRA 9.0 page, and the details outlined here, we tracked down how to add the resourcePhaseCheckpoint.defer option in our script and this has resolved the issue.

ie.

String wrapInScriptTag(content)
{
    //def output = '''<script type="text/javascript">'''+content+'''</script>'''; // v8
    def output = '''<script type="text/javascript">resourcePhaseCheckpoint.defer.then(() => {'''+content+'''});</script>''';  // v9 FIX
}
0 votes
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Nov 16, 2023

It might be helpful to consult this page: https://bitbucket.org/atlassian/platform-module-usage/wiki/aui.md

And review the AUI dependency change associated with your jira upgrade, then review the AUI changelog. E.g. https://aui.atlassian.com/aui/latest/docs/upgrades/aui-9.html#9.2-to-9.3

Also, from your old and new versions of jira, you can run "AJS.version" in your developer panel to get the specific AUI version used in each.

For example, I'm on Jira 8.20.26 and AUI version is 9.2.3-4dc984d9f

That being said, I don't think there are any changes that would cause AJS.$ to error out.

I'm early in my 9.x exploration (waiting for 9.5 LTS), and I've not encountered this (and I do use some AJS.$ functions). So perhaps a more specific/detailed example would help.

Matt Doar
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Nov 16, 2023

It may also be worth reaching out to the support team at Adaptavist, the ScriptRunner vendor

Suggest an answer

Log in or Sign up to answer