Forums

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

Why is JIRA 8.11.1 causing issues when using inline text using javascript?

Shahriar Kabir September 9, 2020

We use JIRA server. We recently upgraded our JIRA version to 8.11.1. Since the upgrade, we have been having problem with editing issues on view screen. 

We use inline text for some of our text fields. Please see the screenshots below.

Screen Shot 2020-09-09 at 9.53.50 AM.png

Screen Shot 2020-09-09 at 10.00.39 AM.png

In order to do that, I enter javascript in those field configuration.

<script type="text/javascript">
document.getElementsByName('customfield_14405')[0].placeholder='This is an inline text';
</script>

I have been using this in our JIRA for a long time and it has worked fine with no problems. Since the upgrade, those javascripts are causing issues. They are preventing us from being able to edit text fields in JIRA issue on view screen which is very strange. If I remove those scripts and go back to the view screen of the JIRA issue, I am able to edit text fields. 

NOTE - I even tried changing my script and used the following but that causes more problems: 

document.getElementsByID
document.getElementByID
document.getElementByName
getElementsByTagName

We reached out to Atlassian about it and based on the conversation, they are not sure why this is happening. They are trying to point the finger to the javascript but there is nothing wrong with the script. I have used this before and it has worked fine, but since the upgrade this problem is going on. 

Does anyone know what exactly is causing this? 
Does anyone know how to fix it? 
Has anyone had this type of problem in JIRA v8.11.1? 

 

Thanks

1 answer

0 votes
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.
September 9, 2020

I'm afraid Atlassian are probably right here.  Javascript injection is unsupported and unsupportable, so they won't have looked too closely, but there is definitely something wrong in the javascript - it's doing something wrong.

You should remove the script and look to implementing what it's trying to do properly in a supported way.

Steven Carmean September 14, 2020

But why was it working fine prior to upgrading from 8.5.5 and all the sudden its broken in 8.11.1?

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.
September 14, 2020

This would be down to a change of library, variables, or structure of the JS in Jira.  This changes are going to happen in new versions, and your best option is to not inject unsupportable js in this way.

Suggest an answer

Log in or Sign up to answer