JIRA - Inline script does not work in issue detail view if script type is module

Viewed 17

I have a custom field which is a countdown timer. I set the time value inside an inline script in velocity. However, I've encountered something strange(at least for me).

<script type="module"> works in the issue view but not in the detail view. When I change the type to "text/javascript", it works just the opposite. What is the reason behind it?

<script type="module">

</script>

issue view: enter image description here

issue detail view: enter image description here

Workaround

I have set the main script type as module to make it run in the issue view. I have also added another script which has text/javascript type in order to make it run in detail view and change the main script's type.

        <script type="text/javascript">
            var timerScript = document.getElementById('timerScript');
            timerScript.setAttribute('type', 'text/javascript');
        </script>

        <!-- main script -->
        <script type="module" id="timerScript">
0 Answers
Related