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

Deleted user February 10, 2013

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 votes
Answer accepted
Deleted user February 16, 2013
0 votes
Deleted user February 11, 2013

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.

0 votes
Deleted user February 10, 2013

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.
0 votes
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.
February 10, 2013

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)

0 votes
Deleted user February 10, 2013

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 votes
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.
February 10, 2013

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?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events