Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Personal Javascript not automatically loaded in JIRA 8.

Pole applications et plateformes web
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 18, 2019

I just migrated my JIRA server from 7.3.0 to 8.1.0 and I have difficulty to make my personal Javascript work.

This javascript is inserted in the description of a personal field.

It appears that the javascript was automatically played when I displayed an Issue containing that field in JIRAv7.3.0.

After migration, in JIRAv8.1.0 the javascript is not automatically played when the issue page is loaded (or the issue create). But in that same page the javascript is well played when I do clic on the field (containing the javascript code) to edit it.

Can you reproduce this behavior ? Is there a way to auto-load personal javascript in JIRA v8.1.0 issues  ?

Thanks for reading me.

 

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 21, 2019

I suspect that if you inspect your pages with your browser's development tools, you will find that the javascript you have injected is running, but is no longer doing anything because of the changes to the way pages work in Jira 8.

Atlassian are gradually removing the ability to use js in descriptions (it doesn't work at all in Cloud, and Server is going that way) because it is unsafe, unreliable and they change the way js is used so often, you really don't want to be using it.

TLDR: you will need to rewrite your javascript from scratch, to fit in with the latest js usage Atlassian have used.

Pole applications et plateformes web
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 22, 2019

Thanks for you reply.

My personal JS is running only when there is an Event (a clic) on the field containing the JS code in the field description. Anyone could test with a simple JS code :

alert( 'Hello, world!' );

 

I do not need to rewrite my javascript from scratch. There are effectively only little modifications to apply to my code. But my main JS code is the same.

 

I try to fit my JS code to the js usage Atlassian used. But can you advise me more ? What is the js usage Atlassian used ? Is there a documentation (on "how inject javascript in Jira 8") I could refer to ?

 

The solution I found till now is using the javascript insider module JsIncluder. I think the Custom JS module could also work.

Suggest an answer

Log in or Sign up to answer