after upgrade from jira 4.1.1 to jira 5.1.6 some workflow transitions don't work

Hi,

after upgrading our jira some workflow transitions don't work.

when pressing the transition button the following happens:

the loading icon appears and it keeps loading forever.

firebug shows that a successful 302 took place to the correct transition form.

If I copy the url from the firebug and paste it in the browser, I get the form. If I do this, the form loads with bad css formatting, but it's readable and I can complete the transition this way.

If i rightclick the transition button and choose open in new window I get the correct transition form and i can complete the transition.

6 answers

1 accepted

0 vote

What post-functions and validators do you have on the transition? If there are any based on post-functions provided by plugins, have you checked that those are the right versions? You've used the tag "javascrip" - is there a reason for that?

What does your log file say?

It looks like the problem is caused by javascript in field descriptions.
The javascript uses jQuery. When it loads in a separate page JIRA provides jQuery and it works fine.
But when it loads with the inline=true parameter, no jQuery is provided. For this reason a javascript errors occur.
I assume the javascript error messes up the javascript chain on the page. this prevents the loading animation to stop and the form to properly display.

i've added this tag to one of the scripts:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>

this tag provides jQuery. this seems to have solved the problem for this particular transition.

Howerver, loading a foreign jQuery like this overrides some atalssian customizations so it's still pretty broken...

0 vote

Ah, that explains the tag. I assume that if you remove the javascript, it behaves ok?

Version 5 made some very sweeping changes to javascript frameworks and methods, so a lot of it needs rewriting on upgrade. The handful I use had to be done pretty much from scratch (although most of it simply went in the bin because it was working around things that v5 started to supply).

I don't know javascript well enough to help you with the details, but I did find that trying to import externals was a nightmare, as it interfered with the Atlassian stuff. I found it better to use the stuff Jira already exposes whereever possible (or, rather, I found lots of answers here encouraging that approach)

Have a look at

https://answers.atlassian.com/questions/27160/how-do-you-embed-javascript-for-a-custom-field-in-jira-5-x

https://developer.atlassian.com/display/JIRADEV/Custom+Fields+that+use+CSS+or+JavaScript+Web+Resources+in+JIRA+5.0 (for some of the background to this)

Thanks for the tip, Nic. Looks like encasing my stuff in

{code}
AJS.$(document).bind('dialogContentReady', function(event, dialog) {});
{code}

Does the trick. I guess I'll need to read into the framework atalassian built. Maybe this is the only solution.
However, this isn't a very good solution for me, since i have dozens of scripts. Maybe i'll do a batch solution.. like search and replace all my scripts through the database..
but there must be a better way.

Yea, i definetly need to read into AJS.

using 'dialogContentReady' for binding only works for popup dialogues. so if it's not a popup dialog the script won't run at all.

using JIRA.Events.NEW_CONTENT_ADDED works if the script only requires the field itself to be loaded.. still need to find a bind that answers all.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

231 views 1 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you